Regular Expression Between Exclude Needs Group Name?

I thought I used this expression (below) with success, but Expresso Regex Builder keeps returning this error:

Error: Invalid Group Name. Group names must begin with a word character

I'm trying to extract everything between ^ and ^ but exclude both ^

(?<\^).*(?=\^)
pointemanAsked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
Check the second group:
Match match = Regex.Match("^12345^", "\^(.*?)\^");
 
string result = match.Groups[1].Value;

Open in new window

0
 
käµfm³d 👽Commented:
Try

\^(.*?)\^
0
 
obrienslalomCommented:
The syntax (?<groupname>pattern) can be used to name a capture group.  The assertions are probably overkill for something like this anyway.  You can get your data by utilizing your capture groups.  Note: the ^ character is an anchor, so they are escaped in the expression.

\^(.*?)\^

Open in new window

0
 
obrienslalomCommented:
Sorry kaufmed...ignore my post
0
 
pointemanAuthor Commented:
This: \^(.*?)\^
Returns this: ^12345678^
I also need to exclude both ^ from the result...
0
All Courses

From novice to tech pro — start learning today.