-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RE2::GlobalReplace case insensitive fail with OR-ed pattern AB|AC #477
Comments
Many thanks for the report! It seems that you have uncovered an ancient bug: this line fails to preserve the |
copybara-service bot
pushed a commit
that referenced
this issue
Feb 19, 2024
Regexp::LeadingString didn't output Latin1 into flags. In the given pattern, 0xA5 should be factored out, but shouldn't lose its Latin1-ness in the process. Because that was happening, the prefix for accel was 0xC2 0xA5 instead of 0xA5. Note that the former doesn't occur in the given input and so replacements weren't occurring. Fixes #477. Change-Id: Icd36ba0905684d93d6db58e8047c9787918d0cf4
copybara-service bot
pushed a commit
that referenced
this issue
Feb 19, 2024
Regexp::LeadingString didn't output Latin1 into flags. In the given pattern, 0xA5 should be factored out, but shouldn't lose its Latin1-ness in the process. Because that was happening, the prefix for accel was 0xC2 0xA5 instead of 0xA5. Note that the former doesn't occur in the given input and so replacements weren't occurring. Fixes #477. Change-Id: Icd36ba0905684d93d6db58e8047c9787918d0cf4
I noticed some additional, seemingly long-standing sadness around Latin-1 handling that does involve case sensitivity. T_T |
copybara-service bot
pushed a commit
that referenced
this issue
Feb 19, 2024
It turned out that case folding assumed UTF-8 mode, so we would fold, say, 0xD1 to 0xF1 even in Latin-1 mode. Fixes #477. Change-Id: I73aa5c8e33ee0c6041c54e3a7268635915960f64
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
it seems that the commit b2af9b3 has changed the behaviour of the case insensitive call to GlobalReplace.
Before b2af9b3 , the replace call was successful, but now it seems to have stopped working.
I am using ubuntu22 with g++.
To reproduce the issue, you can build and run the code snippet below (include iostream and iomanip which are not rendered by github)
#include <re2/re2.h>
int main()
{
}
thank you!
The text was updated successfully, but these errors were encountered: