diff --git a/spec.html b/spec.html
index 504dbfdee8..1ad5e2bafa 100644
--- a/spec.html
+++ b/spec.html
@@ -35467,7 +35467,8 @@
Syntax
`\` AtomEscape[?UnicodeMode, ?NamedCaptureGroups]
CharacterClass[?UnicodeMode, ?UnicodeSetsMode]
`(` GroupSpecifier[?UnicodeMode]? Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)`
- `(?:` Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)`
+ `(?` RegularExpressionFlags `:` Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)`
+ `(?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction[?UnicodeMode, ?UnicodeSetsMode, ?NamedCaptureGroups] `)`
SyntaxCharacter :: one of
`^` `$` `\` `.` `*` `+` `?` `(` `)` `[` `]` `{` `}` `|`
@@ -35712,6 +35713,27 @@ Static Semantics: Early Errors
It is a Syntax Error if the MV of the first |DecimalDigits| is strictly greater than the MV of the second |DecimalDigits|.
+ Atom :: `(?` RegularExpressionFlags `:` Disjunction `)`
+
+ -
+ It is a Syntax Error if the source text matched by |RegularExpressionFlags| contains any code point other than `i`, `m`, or `s`, or if it contains the same code point more than once.
+
+
+ Atom :: `(?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)`
+
+ -
+ It is a Syntax Error if the source text matched by the first |RegularExpressionFlags| and the source text matched by the second |RegularExpressionFlags| are both empty.
+
+ -
+ It is a Syntax Error if the source text matched by the first |RegularExpressionFlags| contains any code point other than `i`, `m`, or `s`, or contains the same code point more than once.
+
+ -
+ It is a Syntax Error if the source text matched by the second |RegularExpressionFlags| contains any code point other than `i`, `m`, or `s`, or contains the same code point more than once.
+
+ -
+ It is a Syntax Error if any code point in the source text matched by the first |RegularExpressionFlags| is also contained in the source text matched by the second |RegularExpressionFlags|.
+
+
AtomEscape :: `k` GroupName
-
@@ -36892,9 +36914,19 @@
Parentheses of the form `(` |Disjunction| `)` serve both to group the components of the |Disjunction| pattern together and to save the result of the match. The result can be used either in a backreference (`\\` followed by a non-zero decimal number), referenced in a replace String, or returned as part of an array from the regular expression matching Abstract Closure. To inhibit the capturing behaviour of parentheses, use the form `(?:` |Disjunction| `)` instead.
- Atom :: `(?:` Disjunction `)`
+ Atom :: `(?` RegularExpressionFlags `:` Disjunction `)`
+
+ 1. Let _addModifiers_ be the source text matched by |RegularExpressionFlags|.
+ 1. Let _removeModifiers_ be the empty String.
+ 1. Let _modifiedRer_ be UpdateModifiers(_rer_, CodePointsToString(_addModifiers_), _removeModifiers_).
+ 1. Return CompileSubpattern of |Disjunction| with arguments _modifiedRer_ and _direction_.
+
+ Atom :: `(?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction `)`
- 1. Return CompileSubpattern of |Disjunction| with arguments _rer_ and _direction_.
+ 1. Let _addModifiers_ be the source text matched by the first |RegularExpressionFlags|.
+ 1. Let _removeModifiers_ be the source text matched by the second |RegularExpressionFlags|.
+ 1. Let _modifiedRer_ be UpdateModifiers(_rer_, CodePointsToString(_addModifiers_), CodePointsToString(_removeModifiers_)).
+ 1. Return CompileSubpattern of |Disjunction| with arguments _modifiedRer_ and _direction_.
@@ -37042,6 +37074,33 @@
In case-insignificant matches when HasEitherUnicodeFlag(_rer_) is *false*, the mapping is based on Unicode Default Case Conversion algorithm toUppercase rather than toCasefold, which results in some subtle differences. For example, `Ω` (U+2126 OHM SIGN) is mapped by toUppercase to itself but by toCasefold to `ω` (U+03C9 GREEK SMALL LETTER OMEGA) along with `Ω` (U+03A9 GREEK CAPITAL LETTER OMEGA), so *"\u2126"* is matched by `/[ω]/ui` and `/[\u03A9]/ui` but not by `/[ω]/i` or `/[\u03A9]/i`. Also, no code point outside the Basic Latin block is mapped to a code point within it, so strings such as *"\u017F ſ"* and *"\u212A K"* are not matched by `/[a-z]/i`.
+
+
+
+ UpdateModifiers (
+ _rer_: a RegExp Record,
+ _add_: a String,
+ _remove_: a String,
+ ): a RegExp Record
+
+
+
+ 1. Let _ignoreCase_ be _rer_.[[IgnoreCase]].
+ 1. Let _multiline_ be _rer_.[[Multiline]].
+ 1. Let _dotAll_ be _rer_.[[DotAll]].
+ 1. Let _unicode_ be _rer_.[[Unicode]].
+ 1. Let _unicodeSets_ be _rer_.[[UnicodeSets]].
+ 1. Let _capturingGroupsCount_ be _rer_.[[CapturingGroupsCount]].
+ 1. If _add_ contains *"i"*, set _ignoreCase_ to *true*.
+ 1. If _add_ contains *"m"*, set _multiline_ to *true*.
+ 1. If _add_ contains *"s"*, set _dotAll_ to *true*.
+ 1. If _remove_ contains *"i"*, set _ignoreCase_ to *false*.
+ 1. If _remove_ contains *"m"*, set _multiline_ to *false*.
+ 1. If _remove_ contains *"s"*, set _dotAll_ to *false*.
+ 1. Return the RegExp Record { [[IgnoreCase]]: _ignoreCase_, [[Multiline]]: _multiline_, [[DotAll]]: _dotAll_, [[Unicode]]: _unicode_, [[UnicodeSets]]: _unicodeSets_, [[CapturingGroupsCount]]: _capturingGroupsCount_ }.
+
+
@@ -49718,7 +49777,8 @@ Syntax
`\` [lookahead == `c`]
CharacterClass[~UnicodeMode, ~UnicodeSetsMode]
`(` GroupSpecifier[~UnicodeMode]? Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)`
- `(?:` Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)`
+ `(?` RegularExpressionFlags `:` Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)`
+ `(?` RegularExpressionFlags `-` RegularExpressionFlags `:` Disjunction[~UnicodeMode, ~UnicodeSetsMode, ?NamedCaptureGroups] `)`
InvalidBracedQuantifier
ExtendedPatternCharacter