I wrote the following pattern:
@"<([0-9]+)>(.*?) < /$1>"
but it doesn't work. how could i refer to the first group?
source text:
"Method()<0>int x = 0; while(x < 10)<1>echo(x)< /1>< /0>"
I wrote the following pattern:
@"<([0-9]+)>(.*?) < /$1>"
but it doesn't work. how could i refer to the first group?
source text:
"Method()<0>int x = 0; while(x < 10)<1>echo(x)< /1>< /0>"
That would be \1
, and watch for spaces.
See also: .Net Regex Backreferencing