开发者

c# regexp pattern to <id> .... </id>

I wrote the following pattern:

@"<([0-9]+)>(.*?) < /$1&g开发者_Go百科t;"

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜