Boost C++ Libraries: Ticket #9380: regex return empty submatch on some machines/compilers https://svn.boost.org/trac10/ticket/9380 <p> Upgraded to 1.55.0 and now this regex fails on our 32bit Ubuntu, but still works fine on our 64bit Ubuntu and <a class="missing wiki">RedHat</a> variants. </p> <p> Configuration is: Ubuntu 8.04.4 LTS, 32bit, gcc 4.2.4 </p> <pre class="wiki"> bool parseBusName(const std::string&amp; busName) const { boost::regex regularExpressionBus ("^([^\[]+)\[([0-9]+)-([0-9]+)\]", boost::regex::extended); boost::cmatch w; if(!regex_match(busName.c_str(), w, regularExpressionBus)) return false; std::cerr &lt;&lt; w.size() &lt;&lt; " &gt;" &lt;&lt; w[1] &lt;&lt; "&lt; &gt;" &lt;&lt; w[2] &lt;&lt; "&lt; &gt;" &lt;&lt; w[3] &lt;&lt; "&lt;" &lt;&lt; std::endl; return true; } parseBusName("top[0-1]") output is: 4 &gt;&lt; &gt;&lt; &gt;&lt; expected: 4 &gt;top&lt; &gt;0&lt; &gt;1&lt; </pre><p> We where previously running boost 1.48.0 which worked fine on all our configurations. </p> <p> NOTE: Replacing boost::regex::extended with boost::regex::perl makes the test pass again on 32bit/gcc4.2.4. </p> <p> Thanks, Jannich </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9380 Trac 1.4.3 John Maddock Thu, 19 Dec 2013 17:00:23 GMT <link>https://svn.boost.org/trac10/ticket/9380#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9380#comment:1</guid> <description> <p> Actually that shouldn't work in any compiler/situation, you need </p> <p> <code>"^([^\\[]+)\\[([0-9]+)-([0-9]+)\\]"</code> </p> <p> as the regular expression if it really is embedded in code like that. </p> <p> Then it works for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 20 Dec 2013 13:35:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9380#comment:2 https://svn.boost.org/trac10/ticket/9380#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">worksforme</span> </li> </ul> <p> Update: I've now had a chance to try this on Ubuntu (64-bit, but using -m32 to build 32-bit binaries) and it works fine for me. </p> <p> Only thing I can think of is that you've somehow got the headers and/or binaries mismatched (ie different versions) on that machine? </p> Ticket