mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibRegex: Correctly parse BRE bracket expressions
Commonly, bracket expressions are in fact, enclosed in brackets.
This commit is contained in:
parent
1c69c686e3
commit
1c584e9d80
2 changed files with 19 additions and 5 deletions
|
@ -1149,4 +1149,10 @@ TEST_CASE(bre_basic)
|
|||
EXPECT_EQ(regcomp(®ex, "15{1,2}", REG_NOSUB | REG_ICASE), REG_NOERR);
|
||||
EXPECT_EQ(regexec(®ex, "15{1,2}", 0, NULL, 0), REG_NOERR);
|
||||
regfree(®ex);
|
||||
|
||||
EXPECT_EQ(regcomp(®ex, "1[56]", REG_NOSUB | REG_ICASE), REG_NOERR);
|
||||
EXPECT_EQ(regexec(®ex, "15", 0, NULL, 0), REG_NOERR);
|
||||
EXPECT_EQ(regexec(®ex, "16", 0, NULL, 0), REG_NOERR);
|
||||
EXPECT_EQ(regexec(®ex, "17", 0, NULL, 0), REG_NOMATCH);
|
||||
regfree(®ex);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue