Multiline you regex bastard

“I said multiline you F*^k” I shouted repeatedly as my c# kept failing to match my regex. I did have
[code lang=”cpp”]
(<span>)(.*?)(</span>)
[/code]

in multiline mode but I also needed ^$

[code lang=”cpp”]
(<span>)([^$.]*?)(</span>)
[/code]

At last

Update… no it wasnt.

What I needed was singleLine option instead of multiline. Where is the logic???

[code lang=”cpp”]
(<span>)(.*?)(</span>)
[/code]

with the /s or System.Text.RegularExpressions.RegexOptions.Singleline incase you have the same problem as me 🙂