Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to have dot (.) match newline in C++ TR1 Regular Expressions?

Tags:

c++

regex

tr1

I couldn't find anything regarding this on http://msdn.microsoft.com/en-us/library/bb982727.aspx.

Maybe I could use '[^]+' to match everything but that seems like a hack?

Thanks.

like image 415
kliao Avatar asked Jan 12 '10 21:01

kliao


1 Answers

Boost.Regex has a mod_s flag to make the dot match newlines, but it's not part of the TR1 regex standard. (and not available as a Microsoft extension either, as far as I can see)

As a workaround, you could use [\s\S] (which means match any whitespace or any non-whitespace).

like image 127
Nicolás Avatar answered Oct 13 '22 00:10

Nicolás