开发者

C# Regex Match any text between tags including new lines

Here is my regex:

\[\[START\]\]\[\[OK\]\](.*?)\[\[END\]\]

I want to get any text contained in [[START]][[OK]] and [[END]]开发者_StackOverflow中文版.

However when my text contains some \r\n characters, my regex doesn't match it.

How can it make it work?


Use single-line mode

http://msdn.microsoft.com/en-us/library/yd1hzczs.aspx#Singleline


I don't know for sure if this works for RegEx'es as well,but you could try using Environment.NewLine in stead of \r\n.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜