Here is my regex:
这是我的正则表达式:
\[\[START\]\]\[\[OK\]\](.*?)\[\[END\]\]
I want to get any text contained in [[START]][[OK]]
and [[END]]
.
我想获得[[START]] [[OK]]和[[END]]中包含的任何文字。
However when my text contains some \r\n
characters, my regex doesn't match it.
但是,当我的文本包含一些\ r \ n字符时,我的正则表达式与它不匹配。
How can it make it work?
它怎么能使它工作?
2 个解决方案
#2
1
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.
我不确定这是否适用于RegEx'es,但您可以尝试使用Environment.NewLine而不是\ r \ n。
#1
#2
1
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.
我不确定这是否适用于RegEx'es,但您可以尝试使用Environment.NewLine而不是\ r \ n。