summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-01-25 13:30:27 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-01-26 00:53:09 +0330
commit5fac41f733ace1135412c00327d8cc8d21c342ff (patch)
tree921378a50b3200ceb75839dadecea9a70f8febe9 /Userland/Libraries/LibC
parent98183ef572298e5541b1cdabc2021c1cd24f3373 (diff)
downloadserenity-5fac41f733ace1135412c00327d8cc8d21c342ff.zip
LibRegex: Implement ECMA262 multiline matching without splitting lines
As ECMA262 regex allows `[^]` and literal newlines to match newlines in the input string, we shouldn't split the input string into lines, rather simply make boundaries and catchall patterns capable of checking for these conditions specifically.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r--Userland/Libraries/LibC/regex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/regex.h b/Userland/Libraries/LibC/regex.h
index 3697286de6..a01ea1d3c4 100644
--- a/Userland/Libraries/LibC/regex.h
+++ b/Userland/Libraries/LibC/regex.h
@@ -83,6 +83,7 @@ enum __RegexAllFlags {
__Regex_SkipTrimEmptyMatches = __Regex_Global << 13, // Do not remove empty capture group results.
__Regex_Internal_Stateful = __Regex_Global << 14, // Internal flag; enables stateful matches.
__Regex_Internal_BrowserExtended = __Regex_Global << 15, // Internal flag; enable browser-specific ECMA262 extensions.
+ __Regex_Internal_ConsiderNewline = __Regex_Global << 16, // Internal flag; allow matchers to consider newlines as line separators.
__Regex_Last = __Regex_SkipTrimEmptyMatches
};
@@ -97,7 +98,6 @@ enum __RegexAllFlags {
#define REG_NOTBOL __Regex_MatchNotBeginOfLine // The circumflex character (^), when taken as a special character, will not match the beginning of string.
#define REG_NOTEOL __Regex_MatchNotEndOfLine // The dollar sign ($), when taken as a special character, will not match the end of string.
-//static_assert (sizeof(FlagsUnderlyingType) * 8 >= regex::POSIXFlags::Last << 1), "flags type too small")
#define REG_SEARCH __Regex_Last << 1
int regcomp(regex_t*, const char*, int);