开发者

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

开发者 https://www.devze.com 2023-01-16 05:37 出处:网络
I wrote the following pattern: @\"<([0-9]+)>(.*?) < /$1&g开发者_Go百科t;\" but it doesn\'t work.

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

精彩评论

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