-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Case-insensitive matching in RE2 uses "simple" (as opposed to "full") Unicode case-folding.
RE2 documentation does not mention this aspect. User has to write a test to find it out.
Some other regex engines can do full case-folding (for instance, ICU and regex). It would be awesome if RE2 could do this too.
#include <re2/re2.h>
#include <gtest/gtest.h>
TEST(FullCaseFolding, FullCaseFolding)
{
RE2::Options options;
options.set_case_sensitive(false);
EXPECT_TRUE(RE2::FullMatch("grüßen", RE2("GRÜSSEN", options)));
EXPECT_TRUE(RE2::FullMatch("GRÜSSEN", RE2("grüßen", options)));
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Metadata
Metadata
Assignees
Labels
No labels