Boost C++ Libraries: Ticket #12960: Line break \R in x-mode https://svn.boost.org/trac10/ticket/12960 <p> Bug: get_escape_R_string() </p> <p> This function injects whitespace literals in the return string.<br /> This is a problem in x-mode since the whitespace<br /> is ignored when it's re-parsed, which then throws an exception. </p> <hr /> <p> File: boost\regex\v4\regex_traits_defaults.hpp </p> <p> Function: get_escape_R_string() </p> <pre class="wiki">template &lt;class charT&gt; inline const charT* get_escape_R_string() { #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable:4309 4245) #endif static const charT e1[] = { '(', '?', '&gt;', '\x0D', '\x0A', '?', '|', '[', '\x0A', '\x0B', '\x0C', static_cast&lt;unsigned char&gt;('\x85'), '\\', 'x', '{', '2', '0', '2', '8', '}', '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' }; static const charT e2[] = { '(', '?', '&gt;', '\x0D', '\x0A', '?', '|', '[', '\x0A', '\x0B', '\x0C', static_cast&lt;unsigned char&gt;('\x85'), ']', ')', '\0' }; charT c = static_cast&lt;charT&gt;(0x2029u); bool b = (static_cast&lt;unsigned&gt;(c) == 0x2029u); return (b ? e1 : e2); #ifdef BOOST_MSVC # pragma warning(pop) #endif } </pre><hr /> <p> Can be fixed by converting the whitespace characters<br /> to hex string literal. </p> <pre class="wiki"> static const charT e1[] = { '(', '?', '&gt;', '\\', 'x', '0', 'D', '\\', 'x', '0', 'A', '?', '|', '[', '\\', 'x', '0', 'A', '\\', 'x', '0', 'B', '\\', 'x', '0', 'C', '\\', 'x', '8', '5', '\\', 'x', '{', '2', '0', '2', '8', '}', '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' }; static const charT e2[] = { '(', '?', '&gt;', '\\', 'x', '0', 'D', '\\', 'x', '0', 'A', '?', '|', '[', '\\', 'x', '0', 'A', '\\', 'x', '0', 'B', '\\', 'x', '0', 'C', '\\', 'x', '8', '5', ']', ')', '\0' }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12960 Trac 1.4.3 John Maddock Thu, 03 Aug 2017 17:05:53 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12960#comment:1 https://svn.boost.org/trac10/ticket/12960#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks for spotting this, fixed in <a class="ext-link" href="https://github.com/boostorg/regex/commit/a32e0cc9d39f8c0886fe5576022c7bf0c9efc265"><span class="icon">​</span>https://github.com/boostorg/regex/commit/a32e0cc9d39f8c0886fe5576022c7bf0c9efc265</a> </p> Ticket