-
Notifications
You must be signed in to change notification settings - Fork 834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c++ regex_match native Ubuntu vs WSL #4046
Comments
I found the issue is that even in WSL we have \r\n line ending style |
Neither WSL/RealLinux kernel nor the Windows kernel "have \r\n" line ending style. Your input file has a line ending style. This snippet will behave the same on Real Linux and WSL given the same input. You'll need more code to handle files with differing eol conventions, if that's a design goal. Bonus points for handling all the charset eol conventions, a common one on Windows being UTF16. [Which is needed if your program is going to consume assembler like strings containing characters other than 'merican.]
Short answer is strip the Long answer is use a library like libicu because you can't even assume a |
I have some strange behavior while using both Ubuntu and Ubuntu on Win 10 (WSL). Both versions are 18.04 and GCC, and I'm compiling with these flags:
-std=c++11 -g
.My problem is that I have this regular expression:
^[\\t ]*(?:([.A-Za-z0-9_]+[:]))?(?:[\\t ]*([A-Za-z]{2,4})(?:[\\t ]+(@[A-Za-z0-9_]+(?:(?:\\+|-)[0-9]+)?|\".+?\"|\'.+?\'|[.A-Za-z0-9_]+)(?:[\\t ]*[,][\\t ]*(@[A-Za-z0-9_]+(?:(?:\\+|-)[0-9]+)?|\".+?\"|\'.+?\'|[.A-Za-z0-9_]+))?(?:[\\t ]*[,][\\t ]*(@[A-Za-z0-9_]+(?:(?:\\+|-)[0-9]+)?|\".+?\"|\'.+?\'|[.A-Za-z0-9_]+))?)?)?
for matching some assembler-like string (yeah, I know it's long).
I'm using it like this :
This piece of code is working well on my native Ubuntu installation, but on the WSL version of Ubuntu
regex_match
always returns false.Have some of you already encountered this? And if so, how have you managed it ?
The text was updated successfully, but these errors were encountered: