[Boost-bugs] [Boost C++ Libraries] #11940: difference between perl and boost::regex in perl mode

Subject: [Boost-bugs] [Boost C++ Libraries] #11940: difference between perl and boost::regex in perl mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-01-26 07:41:07


#11940: difference between perl and boost::regex in perl mode
------------------------------+-------------------------
 Reporter: info@… | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost 1.59.0 | Severity: Problem
 Keywords: |
------------------------------+-------------------------
 Please consider the following code snippet:

 const boost::regex r( "(?i:hour)|H");
 std::string s( "H");
 boost::smatch m;
 s = boost::regex_match( s, m, r) ? "YES" : "no";
 // s contains "no", but perl says "YES"

 the corresponding perl one-liner
 perl -E 'say "H" =~ /^(?i:hour)|H$/ ? "YES" : "no"'
 writes out YES (as expected)

 This is only a short example, there is erratic behaviour as long as
 (?i:pattern) is involved with alternation.

 The example was compiled with mingw:

 $ gcc -v
 Using built-in specs.
 COLLECT_GCC=...\dev52031\c\bin\gcc.exe
 COLLECT_LTO_WRAPPER=.../dev52031/c/bin/../libexec/gcc/i686-w64-mingw32/4.8.3
 /lto-wrapper.exe
 Target: i686-w64-mingw32
 Configured with: ../../../src/gcc-4.8.3/configure --host=i686-w64-mingw32
 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32
 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-
 shared --enable-static --disable-multilib --enable-
 languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-
 threads=posix --enable-libgomp --enable-lto --enable-graphite --enable-
 checking=release --enable-fully-dynamic-string --enable-version-specific-
 runtime-libs --enable-sjlj-exceptions --disable-isl-version-check
 --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-
 debug --disable-bootstrap --disable-rpath --disable-win32-registry
 --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-
 ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib
 --with-gmp=/opt/build/prerequisites/i686-w64-mingw32-static --with-
 mpfr=/opt/build/prerequisites/i686-w64-mingw32-static --with-
 mpc=/opt/build/prerequisites/i686-w64-mingw32-static --with-
 isl=/opt/build/prerequisites/i686-w64-mingw32-static --with-
 cloog=/opt/build/prerequisites/i686-w64-mingw32-static --enable-cloog-
 backend=isl --with-pkgversion='i686-posix-sjlj,
 built by strawberryperl.com project' CFLAGS='-O2 -pipe
 -I/opt/build/i686-483-posix-sjlj-rt_v3/mingw32/opt/include
 -I/opt/build/prerequisites/i686-zlib-static/include
 -I/opt/build/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2
 -pipe -I/opt/build/i686-483-posix-sjlj-rt_v3/mingw32/opt/include
 -I/opt/build/prerequisites/i686-zlib-static/include
 -I/opt/build/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS=
 LDFLAGS='-pipe -L/opt/build/i686-483-posix-sjlj-rt_v3/mingw32/opt/lib
 -L/opt/build/prerequisites/i686-zlib-static/lib
 -L/opt/build/prerequisites/i686-w64-mingw32-static/lib'
 Thread model: posix
 gcc version 4.8.3 (i686-posix-sjlj, built by strawberryperl.com project)

 The library was build with:

 set toolset=gcc
 set d1=define=BOOST_THREAD_USE_LIB define=BOOST_LOG_WITHOUT_EVENT_LOG
 define=BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
 set l1=--without-context --without-coroutine --without-coroutine2
 --without-graph --without-graph_parallel
 set l2= --without-math --without-mpi --without-python --without-signals
 --without-wave
 set f1=-a -q --prefix=%drivep%\boost toolset=gcc
 set t1=--layout=tagged link=static threading=multi runtime-link=shared
 set w1=cxxflags="-std=c++11 -Wno-unused-local-typedefs -Wno-unknown-
 pragmas"

 .\b2 %d1% %l1% %l2% %f1% %t1% %w1% stage
 .\b2 %d1% %l1% %l2% %f1% %t1% %w1% install

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11940>
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:19 UTC