tst2005googlecode / re2

Automatically exported from code.google.com/p/re2
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

runtime failure: Windows + mingw + wide characters #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile using mingw NO_THREADS
2. Compile the simple example and run
3.

What is the expected output? What do you see instead?
Expected: run silently without errors.
Result: 
# .\testre2.exe
re2/re2.cc:153: Error parsing '(\w+):(\d+)': invalid escape sequence: \w
re2/re2.cc:704: Invalid RE2: invalid escape sequence: \w
Assertion failed: RE2::FullMatch("ruby:1234", "(\\w+):(\\d+)", &s, &i),
file tes
tre2.cpp, line 11

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

What version of the product are you using? On what operating system?

Windows Vista Home Edition, ming32 gcc 4.4.1

Please provide any additional information below.

-----testre2-mk.bat
C:\TDMinGW\bin\g++ testre2.cpp -L. -lre2  -o testre2.exe

-----testre2.cpp
#include <iostream>
#include <string>
#include <assert.h>
#include "re2.h"

using namespace std;

int main(int argc, char *argv[]) {
    int i;
    string s;
    assert(RE2::FullMatch("ruby:1234", "(\\w+):(\\d+)", &s, &i));
    assert(s == "ruby");
    assert(i == 1234);
}
------

Original issue reported on code.google.com by mingo...@gmail.com on 10 Apr 2010 at 7:17

GoogleCodeExporter commented 9 years ago
I have no idea what's wrong here.  This program works fine for me off of 
Windows.
I wonder if it has something to do with wide characters, but I can't imagine 
what.

Original comment by rsc@swtch.com on 16 Jul 2010 at 5:32

GoogleCodeExporter commented 9 years ago

Original comment by rsc@swtch.com on 16 Jul 2010 at 5:33

GoogleCodeExporter commented 9 years ago
This is because MinGW does not implement the wide character portions of the C++ 
standard. It would either need to be fixed upstream in the compiler, or there 
would need to be a #define setting to turn off wide character handling.

Original comment by billy.on...@gmail.com on 30 Apr 2011 at 2:28

GoogleCodeExporter commented 9 years ago
There is a port for the free Microsoft Visual C++ 9 available at, 
http://code.google.com/p/re2win/ . It should handle wide characters just fine!

Original comment by unixma...@gmail.com on 1 Dec 2011 at 6:50

GoogleCodeExporter commented 9 years ago

Original comment by rsc@golang.org on 10 Jan 2014 at 3:18

GoogleCodeExporter commented 9 years ago
RE2 has moved to GitHub. I have not moved the issues over. If this issue is 
still important to you, please file a new one at 
https://github.com/google/re2/issues. Thank you.

Original comment by rsc@golang.org on 11 Dec 2014 at 4:45