[Boost-bugs] [Boost C++ Libraries] #6213: Escaping close parentheses doesn't work in boost::regex

Subject: [Boost-bugs] [Boost C++ Libraries] #6213: Escaping close parentheses doesn't work in boost::regex
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-05 14:31:05


#6213: Escaping close parentheses doesn't work in boost::regex
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner:
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 Currently I am running Boost 1.47 on Scientific Linux 6 and cannot get the
 escaped close parentheses to match in a very simple expression. I can
 remove the escaped close parentheses and the regular expression will
 match, but with the escaped close parentheses, we never can get the if
 statement to work. I can put a small work around in our codebase, but I
 would expect this feature to work. Below is a example snippet of code:

 {{{
 #!div style="font-size: 80%"
   {{{#!C++
 void MyFuction(const std::string& val)
 {
   boost::regex expr1("(.*)\\((.*)\\)");
   boost::regex expr2("(.*)\\((.*)");
   boost::cmatch matches;

   if(boost::regex_match(val.c_str(), matches, expr1)) {
     //never will get in here
   }

   if(boost::regex_match(val.c_str(), matches, expr2)) {
     //will get in here when we expect it to
   }

 }
   }}}
 }}}

 I appologize if there's something on my side that I'm missing, but I
 searched around and really can't find anything in our code base that would
 indicate its our code base and not boost::regex.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6213>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC