Subject: [Boost-bugs] [Boost C++ Libraries] #2340: Regex : Invalid preceding regular expression problem
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-09-18 13:26:40
#2340: Regex : Invalid preceding regular expression problem
-------------------------------+--------------------------------------------
Reporter: jcombe_at_[hidden] | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
Version: Boost 1.36.0 | Severity: Problem
Keywords: regex |
-------------------------------+--------------------------------------------
I have the following code:-
std::cout << "BUILD REGEX" << std::endl;
try
{
boost::u32regex uregex= boost::make_u32regex (
"(.*?)(\\b?\\s?)(\\w*?)&(\\w+?)(\\b\\s?&?)(.*)" , boost::regex::perl );
}
catch ( boost::regex_error x )
{
std::cout << "REGEX ERROR [" << x.what() << "]" << std::endl;
return false;
}
std::cout << "REGEX BUILT" << std::endl;
return false;
When I compile this code and then run it, it throws an exception and
prints this message:-
REGEX ERROR [Invalid preceding regular expression]
When I use this line instead
boost::u32regex uregex= boost::make_u32regex (
"(.*?)(\\b\\s?)(\\w*?)&(\\w+?)(\\b\\s?&?)(.*)" , boost::regex::perl );
It does work.
Both regular expressions compile and run as I expect in Perl. Is it a bug
that this regex does not work in Boost?
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2340> 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:49:58 UTC