Implement wxRegEx using PCRE
Adjust the tests and document the incompatibilities with the previously used regex syntax. In this commit the use of PCRE is conditional on wxUSE_PCRE which is never defined as 1 yet, so the new code is still disabled.
This commit is contained in:
@@ -59,7 +59,7 @@ TEST_CASE("wxRegEx::Compile", "[regex][compile]")
|
||||
CHECK_FALSE( re.Compile("foo[") );
|
||||
CHECK_FALSE( re.Compile("foo[bar") );
|
||||
CHECK ( re.Compile("foo[bar]") );
|
||||
CHECK_FALSE( re.Compile("foo{1") );
|
||||
// Not invalid for PCRE: CHECK_FALSE( re.Compile("foo{1") );
|
||||
CHECK ( re.Compile("foo{1}") );
|
||||
CHECK ( re.Compile("foo{1,2}") );
|
||||
CHECK ( re.Compile("foo*") );
|
||||
@@ -184,4 +184,20 @@ TEST_CASE("wxRegEx::ConvertFromBasic", "[regex][basic]")
|
||||
CHECK( wxRegEx::ConvertFromBasic("[^$\\)]") == "[^$\\)]" );
|
||||
}
|
||||
|
||||
#ifdef wxHAS_REGEX_ADVANCED
|
||||
|
||||
TEST_CASE("wxRegEx::Unicode", "[regex][unicode]")
|
||||
{
|
||||
const wxString cyrillicCapitalA(L"\u0410");
|
||||
const wxString cyrillicSmallA(L"\u0430");
|
||||
|
||||
wxRegEx re(cyrillicCapitalA, wxRE_ICASE);
|
||||
REQUIRE( re.IsValid() );
|
||||
|
||||
REQUIRE( re.Matches(cyrillicSmallA) );
|
||||
CHECK( re.GetMatch(cyrillicSmallA) == cyrillicSmallA );
|
||||
}
|
||||
|
||||
#endif // wxHAS_REGEX_ADVANCED
|
||||
|
||||
#endif // wxUSE_REGEX
|
||||
|
Reference in New Issue
Block a user