Search code examples
c++regextr1

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


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?


Solution

  • 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).