summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexOptions.h
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-02-04 19:29:26 +0330
committerAndreas Kling <kling@serenityos.org>2022-02-05 00:09:32 +0100
commit2b028f6faa3196f2498f29613f66ba374e6c253a (patch)
tree104eebda8875e825d191b5c4b45ab588e1f706fd /Userland/Libraries/LibRegex/RegexOptions.h
parent4c506f91fecd0d795dd69c49d2d5edbada5ae130 (diff)
downloadserenity-2b028f6faa3196f2498f29613f66ba374e6c253a.zip
LibRegex+LibJS: Avoid searching for more than one match in JS RegExps
All of JS's regular expression APIs only want a single match, so avoid trying to produce more (which will be discarded anyway).
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexOptions.h')
-rw-r--r--Userland/Libraries/LibRegex/RegexOptions.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibRegex/RegexOptions.h b/Userland/Libraries/LibRegex/RegexOptions.h
index c9a3533c5b..1460eaf3f0 100644
--- a/Userland/Libraries/LibRegex/RegexOptions.h
+++ b/Userland/Libraries/LibRegex/RegexOptions.h
@@ -33,6 +33,7 @@ enum class AllFlags {
Sticky = __Regex_Sticky, // Force the pattern to only match consecutive matches from where the previous match ended.
Multiline = __Regex_Multiline, // Handle newline characters. Match each line, one by one.
SkipTrimEmptyMatches = __Regex_SkipTrimEmptyMatches, // Do not remove empty capture group results.
+ SingleMatch = __Regex_SingleMatch, // Stop after acquiring a single match.
Internal_Stateful = __Regex_Internal_Stateful, // Make global matches match one result at a time, and further match() calls on the same instance continue where the previous one left off.
Internal_BrowserExtended = __Regex_Internal_BrowserExtended, // Only for ECMA262, Enable the behaviors defined in section B.1.4. of the ECMA262 spec.
Internal_ConsiderNewline = __Regex_Internal_ConsiderNewline, // Only for ECMA262, Allow multiline matches to consider newlines as line boundaries.