mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-24 03:11:53 +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
Notes:
sideshowbarker
2024-07-18 09:24:45 +09:00
Author: https://github.com/alimpfard
Commit: 1c584e9d80
Pull-request: https://github.com/SerenityOS/serenity/pull/8613
Reviewed-by: https://github.com/linusg ✅
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