Ticket #11940: regex_error.txt

File regex_error.txt, 3.2 KB (added by info@…, 7 years ago)

the readable text of the ticket (I'm sorry for bad format of the post)

Line 
1difference between perl and boost::regex in perl mode
2
3
4Please consider the following code snippet:
5
6const boost::regex r( "(?i:hour)|H");
7std::string s( "H");
8boost::smatch m;
9s = boost::regex_match( s, m, r) ? "YES" : "no";
10// s contains "no", but perl says "YES"
11
12the corresponding perl one-liner
13perl -E 'say "H" =~ /^(?i:hour)|H$/ ? "YES" : "no"'
14writes out YES (as expected)
15
16This is only a short example, there is erratic behaviour as long as (?i:pattern) is involved with alternation.
17
18The example was compiled with mingw in windows:
19
20$ gcc -v
21Using built-in specs.
22COLLECT_GCC=...\dev52031\c\bin\gcc.exe
23COLLECT_LTO_WRAPPER=.../dev52031/c/bin/../libexec/gcc/i686-w64-mingw32/4.8.3/lto-wrapper.exe
24Target: i686-w64-mingw32
25Configured 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,
26built 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'
27Thread model: posix
28gcc version 4.8.3 (i686-posix-sjlj, built by strawberryperl.com project)
29
30The library was build with:
31
32set toolset=gcc
33set d1=define=BOOST_THREAD_USE_LIB define=BOOST_LOG_WITHOUT_EVENT_LOG define=BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
34set l1=--without-context --without-coroutine --without-coroutine2 --without-graph --without-graph_parallel
35set l2= --without-math --without-mpi --without-python --without-signals --without-wave
36set f1=-a -q --prefix=%drivep%\boost toolset=gcc
37set t1=--layout=tagged link=static threading=multi runtime-link=shared
38set w1=cxxflags="-std=c++11 -Wno-unused-local-typedefs -Wno-unknown-pragmas"
39
40.\b2 %d1% %l1% %l2% %f1% %t1% %w1% stage
41.\b2 %d1% %l1% %l2% %f1% %t1% %w1% install