On Wed, Mar 25, 2026 at 5:14 PM Rainer Deyke via Boost <boost@lists.boost.org> wrote:
According to documentation (https://www.boost.org/doc/libs/latest/libs/regex/doc/html/boost_regex/syntax...):
R"( )" = "\n" should match itself, like all characters not in .[{}()\*+?|^$
R"(\n)" = "\\n" should match exactly '\n' and not '\r', just like "\n". The documentation is explicit about this.
R"(\r)" = "\\r" should match '\r', as should "\r", for what it's worth.
R"(\\n)" = "\\n" should match "\\n", i.e. a backslash followed by 'n'.
This line isn't correct, is it? Two slashes in the raw string should be four slashes in a normal string.
'$' should match the end of a line, including embedded newlines in the text. It is not clear what qualifies as a newline in this sense, but I'm guessing '\r' might qualify.
Yeah, this makes sense. Also depends on the m modifier:
Normally Boost.Regex behaves as if the Perl m-modifier is on: so the assertions ^ and $ match after and before embedded newlines respectively, setting this flags is equivalent to prefixing the expression with (?-m).
I thought ^ and $ would be begin and end of input by default, but it's the other way around. -- Olaf