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.
精彩评论