Reputation: 13
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>"
Upvotes: 1
Views: 98
Reputation: 137997
That would be \1
, and watch for spaces.
See also: .Net Regex Backreferencing
Upvotes: 2