Boost C++ Libraries: Ticket #13206: regex constructor throws regex_error for simple expression https://svn.boost.org/trac10/ticket/13206 <p> The code below throws boost::regex_error when creating an instance of boost::regex. I compile with visual studio 2015 and uses boost 1.65 precompiled for 32 bit windows (boost_1_65_1-msvc-14.0-32.exe) </p> <p> #include "stdafx.h" #include &lt;boost/regex.hpp&gt; int main() { </p> <blockquote> <p> try { </p> <blockquote> <p> boost::regex re("[A-Z-.]+"); </p> </blockquote> <p> } catch (...) { assert(false); } </p> </blockquote> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13206 Trac 1.4.3 robic@… Thu, 12 Oct 2017 21:26:05 GMT <link>https://svn.boost.org/trac10/ticket/13206#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13206#comment:1</guid> <description> <pre class="wiki">Error: Regex Construction .. Invalid range end in character class '[A-Z-&lt;&lt;&lt;HERE&gt;&gt;&gt;.]+' </pre><p> In Perl, this compiles fine.<br /> The dash here <strong><em>A-Z<code>-</code>.</em></strong> is ambiguous, it should be seen as a literal,<br /> not a range operator.<br /> </p> <p> Not all engines track this, but it is simple to do. </p> </description> <category>Ticket</category> </item> </channel> </rss>