C # Regex Match any text between tags, including newlines

Here is my regex:

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

I want to get the text contained in [[START]][[OK]] and [[END]] .

However, when my text contains multiple characters \r\n , my regular expression does not match it.

How to make it work?

+4
source share
2 answers

I don’t know for sure if this works for RegExs, but you can try using Environment.NewLine instead of \ r \ n.

+1
source

All Articles