Boost C++ Libraries: Ticket #11988: Variable length hexadecimal escape always fails in basic_regex_parser https://svn.boost.org/trac10/ticket/11988 <p> Using a variable length hexadecimal escape <code>\x{41</code>} causes the error <code>Hexadecimal escape sequence was invalid</code>. </p> <p> This appears to be caused by the <code>int</code> cast at <a class="ext-link" href="https://github.com/boostorg/regex/blob/aa6495ae486522456bb0d507cd93f8023c3c4c0c/include/boost/regex/v4/basic_regex_parser.hpp#L1759"><span class="icon">​</span>https://github.com/boostorg/regex/blob/aa6495ae486522456bb0d507cd93f8023c3c4c0c/include/boost/regex/v4/basic_regex_parser.hpp#L1759</a>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11988 Trac 1.4.3 wbond <will@…> Tue, 16 Feb 2016 03:11:39 GMT <link>https://svn.boost.org/trac10/ticket/11988#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11988#comment:1</guid> <description> <p> Specifically, this occurs with the type <code>boost::basic_regex&lt;uint32_t&gt;</code>, which explains why <code>(std::numeric_limits&lt;charT&gt;::max)()</code> it overflows <code>int</code>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 18 Feb 2016 10:20:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11988#comment:2 https://svn.boost.org/trac10/ticket/11988#comment:2 <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> I believe this is now fixed in: </p> <p> <a class="ext-link" href="https://github.com/boostorg/regex/commit/955d077d2b69d7c1014e36d86c737f7eb4b057b7"><span class="icon">​</span>https://github.com/boostorg/regex/commit/955d077d2b69d7c1014e36d86c737f7eb4b057b7</a> </p> <p> plus test cases: </p> <p> <a class="ext-link" href="https://github.com/boostorg/regex/commit/36b2fab2271bc97f8fae86029f587747f9fc1ff4"><span class="icon">​</span>https://github.com/boostorg/regex/commit/36b2fab2271bc97f8fae86029f587747f9fc1ff4</a> <a class="ext-link" href="https://github.com/boostorg/regex/commit/e217808156e482dc1af6b97799e39a2fdfabe3fd"><span class="icon">​</span>https://github.com/boostorg/regex/commit/e217808156e482dc1af6b97799e39a2fdfabe3fd</a> </p> <p> Note that strictly speaking this is still only a partial fix as basic_regex&lt;uintmax_t&gt; could still only parse values up until the largest value of intmax_t. It should fix this for char32_t etc though. </p> Ticket