简体   繁体   中英

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]] .

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

How can it make it work?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM