-
- AtomEscape
- With parameter _direction_.
- The production AtomEscape :: DecimalEscape evaluates as follows:
-
- 1. Evaluate |DecimalEscape| to obtain an integer _n_.
- 1. Assert: _n_ ≤ _NcapturingParens_.
- 1. Return ! BackreferenceMatcher(_n_, _direction_).
-
- The production AtomEscape :: CharacterEscape evaluates as follows:
-
- 1. Evaluate |CharacterEscape| to obtain a character _ch_.
- 1. Let _A_ be a one-element CharSet containing the character _ch_.
- 1. Return ! CharacterSetMatcher(_A_, *false*, _direction_).
-
- The production AtomEscape :: CharacterClassEscape evaluates as follows:
-
- 1. Evaluate |CharacterClassEscape| to obtain a CharSet _A_.
- 1. Return ! CharacterSetMatcher(_A_, *false*, _direction_).
-
-
- An escape sequence of the form `\\` followed by a non-zero decimal number _n_ matches the result of the _n_th set of capturing parentheses (). It is an error if the regular expression has fewer than _n_ capturing parentheses. If the regular expression has _n_ or more capturing parentheses but the _n_th one is *undefined* because it has not captured anything, then the backreference always succeeds.
-
- The production AtomEscape :: `k` GroupName evaluates as follows:
-
- 1. Search the enclosing |Pattern| for an instance of a |GroupSpecifier| containing a |RegExpIdentifierName| which has a CapturingGroupName equal to the CapturingGroupName of the |RegExpIdentifierName| contained in |GroupName|.
- 1. Assert: A unique such |GroupSpecifier| is found.
- 1. Let _parenIndex_ be the number of left-capturing parentheses in the entire regular expression that occur to the left of the located |GroupSpecifier|. This is the total number of Atom :: `(` GroupSpecifier Disjunction `)` Parse Nodes prior to or enclosing the located |GroupSpecifier|, including its immediately enclosing |Atom|.
- 1. Return ! BackreferenceMatcher(_parenIndex_, _direction_).
-
-
-
-
- BackreferenceMatcher (
- _n_: a positive integer,
- _direction_: 1 or -1,
- )
-
-
-
- 1. Assert: _n_ ≥ 1.
- 1. Return a new Matcher with parameters (_x_, _c_) that captures _n_ and _direction_ and performs the following steps when called:
- 1. Assert: _x_ is a State.
- 1. Assert: _c_ is a Continuation.
- 1. Let _cap_ be _x_'s _captures_ List.
- 1. Let _s_ be _cap_[_n_].
- 1. If _s_ is *undefined*, return _c_(_x_).
- 1. Let _e_ be _x_'s _endIndex_.
- 1. Let _len_ be the number of elements in _s_.
- 1. Let _f_ be _e_ + _direction_ × _len_.
- 1. If _f_ < 0 or _f_ > _InputLength_, return ~failure~.
- 1. Let _g_ be min(_e_, _f_).
- 1. If there exists an integer _i_ between 0 (inclusive) and _len_ (exclusive) such that Canonicalize(_s_[_i_]) is not the same character value as Canonicalize(_Input_[_g_ + _i_]), return ~failure~.
- 1. Let _y_ be the State (_f_, _cap_).
- 1. Return _c_(_y_).
-
-
-
-
-
- CharacterEscape
- The |CharacterEscape| productions evaluate as follows:
-
- CharacterEscape ::
- ControlEscape
- `c` ControlLetter
- `0` [lookahead ∉ DecimalDigit]
- HexEscapeSequence
- RegExpUnicodeEscapeSequence
- IdentityEscape
-
-
- 1. Let _cv_ be the CharacterValue of this |CharacterEscape|.
- 1. Return the character whose character value is _cv_.
-
-
-
-
- DecimalEscape
- The |DecimalEscape| productions evaluate as follows:
- DecimalEscape :: NonZeroDigit DecimalDigits?
-
- 1. Return the CapturingGroupNumber of this |DecimalEscape|.
-
-
- If `\\` is followed by a decimal number _n_ whose first digit is not `0`, then the escape sequence is considered to be a backreference. It is an error if _n_ is greater than the total number of left-capturing parentheses in the entire regular expression.
-
-
-
-
- CharacterClassEscape
- The production CharacterClassEscape :: `d` evaluates as follows:
-
- 1. Return the ten-element CharSet containing the characters `0` through `9` inclusive.
-
- The production CharacterClassEscape :: `D` evaluates as follows:
-
- 1. Return the CharSet containing all characters not in the CharSet returned by CharacterClassEscape :: `d` .
-
- The production CharacterClassEscape :: `s` evaluates as follows:
-
- 1. Return the CharSet containing all characters corresponding to a code point on the right-hand side of the |WhiteSpace| or |LineTerminator| productions.
-
- The production CharacterClassEscape :: `S` evaluates as follows:
-
- 1. Return the CharSet containing all characters not in the CharSet returned by CharacterClassEscape :: `s` .
-
- The production CharacterClassEscape :: `w` evaluates as follows:
-
- 1. Return _WordCharacters_.
-
- The production CharacterClassEscape :: `W` evaluates as follows:
-
- 1. Return the CharSet containing all characters not in the CharSet returned by CharacterClassEscape :: `w` .
-
- The production CharacterClassEscape :: `p{` UnicodePropertyValueExpression `}` evaluates as follows:
-
- 1. Return the CharSet containing all Unicode code points included in the CharSet returned by |UnicodePropertyValueExpression|.
-
- The production CharacterClassEscape :: `P{` UnicodePropertyValueExpression `}` evaluates as follows:
-
- 1. Return the CharSet containing all Unicode code points not included in the CharSet returned by |UnicodePropertyValueExpression|.
-
- The production UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue evaluates as follows:
-
- 1. Let _ps_ be SourceText of |UnicodePropertyName|.
- 1. Let _p_ be ! UnicodeMatchProperty(_ps_).
- 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of .
- 1. Let _vs_ be SourceText of |UnicodePropertyValue|.
- 1. Let _v_ be ! UnicodeMatchPropertyValue(_p_, _vs_).
- 1. Return the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value _v_.
-
- The production UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue evaluates as follows:
-
- 1. Let _s_ be SourceText of |LoneUnicodePropertyNameOrValue|.
- 1. If ! UnicodeMatchPropertyValue(`General_Category`, _s_) is identical to a List of Unicode code points that is the name of a Unicode general category or general category alias listed in the “Property value and aliases” column of , then
- 1. Return the CharSet containing all Unicode code points whose character database definition includes the property “General_Category” with value _s_.
- 1. Let _p_ be ! UnicodeMatchProperty(_s_).
- 1. Assert: _p_ is a binary Unicode property or binary property alias listed in the “Property name and aliases” column of .
- 1. Return the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value “True”.
-
-
-
CharacterClass
The production CharacterClass :: `[` ClassRanges `]` evaluates as follows:
@@ -35357,6 +35222,150 @@ ClassEscape
A |ClassAtom| can use any of the escape sequences that are allowed in the rest of the regular expression except for `\\b`, `\\B`, and backreferences. Inside a |CharacterClass|, `\\b` means the backspace character, while `\\B` and backreferences raise errors. Using a backreference inside a |ClassAtom| causes an error.
+
+
+ AtomEscape
+ With parameter _direction_.
+ The production AtomEscape :: DecimalEscape evaluates as follows:
+
+ 1. Evaluate |DecimalEscape| to obtain an integer _n_.
+ 1. Assert: _n_ ≤ _NcapturingParens_.
+ 1. Return ! BackreferenceMatcher(_n_, _direction_).
+
+ The production AtomEscape :: CharacterClassEscape evaluates as follows:
+
+ 1. Evaluate |CharacterClassEscape| to obtain a CharSet _A_.
+ 1. Return ! CharacterSetMatcher(_A_, *false*, _direction_).
+
+
+ An escape sequence of the form `\\` followed by a non-zero decimal number _n_ matches the result of the _n_th set of capturing parentheses (). It is an error if the regular expression has fewer than _n_ capturing parentheses. If the regular expression has _n_ or more capturing parentheses but the _n_th one is *undefined* because it has not captured anything, then the backreference always succeeds.
+
+ The production AtomEscape :: CharacterEscape evaluates as follows:
+
+ 1. Evaluate |CharacterEscape| to obtain a character _ch_.
+ 1. Let _A_ be a one-element CharSet containing the character _ch_.
+ 1. Return ! CharacterSetMatcher(_A_, *false*, _direction_).
+
+ The production AtomEscape :: `k` GroupName evaluates as follows:
+
+ 1. Search the enclosing |Pattern| for an instance of a |GroupSpecifier| containing a |RegExpIdentifierName| which has a CapturingGroupName equal to the CapturingGroupName of the |RegExpIdentifierName| contained in |GroupName|.
+ 1. Assert: A unique such |GroupSpecifier| is found.
+ 1. Let _parenIndex_ be the number of left-capturing parentheses in the entire regular expression that occur to the left of the located |GroupSpecifier|. This is the total number of Atom :: `(` GroupSpecifier Disjunction `)` Parse Nodes prior to or enclosing the located |GroupSpecifier|, including its immediately enclosing |Atom|.
+ 1. Return ! BackreferenceMatcher(_parenIndex_, _direction_).
+
+
+
+
+ BackreferenceMatcher (
+ _n_: a positive integer,
+ _direction_: 1 or -1,
+ )
+
+
+
+ 1. Assert: _n_ ≥ 1.
+ 1. Return a new Matcher with parameters (_x_, _c_) that captures _n_ and _direction_ and performs the following steps when called:
+ 1. Assert: _x_ is a State.
+ 1. Assert: _c_ is a Continuation.
+ 1. Let _cap_ be _x_'s _captures_ List.
+ 1. Let _s_ be _cap_[_n_].
+ 1. If _s_ is *undefined*, return _c_(_x_).
+ 1. Let _e_ be _x_'s _endIndex_.
+ 1. Let _len_ be the number of elements in _s_.
+ 1. Let _f_ be _e_ + _direction_ × _len_.
+ 1. If _f_ < 0 or _f_ > _InputLength_, return ~failure~.
+ 1. Let _g_ be min(_e_, _f_).
+ 1. If there exists an integer _i_ between 0 (inclusive) and _len_ (exclusive) such that Canonicalize(_s_[_i_]) is not the same character value as Canonicalize(_Input_[_g_ + _i_]), return ~failure~.
+ 1. Let _y_ be the State (_f_, _cap_).
+ 1. Return _c_(_y_).
+
+
+
+
+
+ DecimalEscape
+ The |DecimalEscape| productions evaluate as follows:
+ DecimalEscape :: NonZeroDigit DecimalDigits?
+
+ 1. Return the CapturingGroupNumber of this |DecimalEscape|.
+
+
+ If `\\` is followed by a decimal number _n_ whose first digit is not `0`, then the escape sequence is considered to be a backreference. It is an error if _n_ is greater than the total number of left-capturing parentheses in the entire regular expression.
+
+
+
+
+ CharacterClassEscape
+ The production CharacterClassEscape :: `d` evaluates as follows:
+
+ 1. Return the ten-element CharSet containing the characters `0` through `9` inclusive.
+
+ The production CharacterClassEscape :: `D` evaluates as follows:
+
+ 1. Return the CharSet containing all characters not in the CharSet returned by CharacterClassEscape :: `d` .
+
+ The production CharacterClassEscape :: `s` evaluates as follows:
+
+ 1. Return the CharSet containing all characters corresponding to a code point on the right-hand side of the |WhiteSpace| or |LineTerminator| productions.
+
+ The production CharacterClassEscape :: `S` evaluates as follows:
+
+ 1. Return the CharSet containing all characters not in the CharSet returned by CharacterClassEscape :: `s` .
+
+ The production CharacterClassEscape :: `w` evaluates as follows:
+
+ 1. Return _WordCharacters_.
+
+ The production CharacterClassEscape :: `W` evaluates as follows:
+
+ 1. Return the CharSet containing all characters not in the CharSet returned by CharacterClassEscape :: `w` .
+
+ The production CharacterClassEscape :: `p{` UnicodePropertyValueExpression `}` evaluates as follows:
+
+ 1. Return the CharSet containing all Unicode code points included in the CharSet returned by |UnicodePropertyValueExpression|.
+
+ The production CharacterClassEscape :: `P{` UnicodePropertyValueExpression `}` evaluates as follows:
+
+ 1. Return the CharSet containing all Unicode code points not included in the CharSet returned by |UnicodePropertyValueExpression|.
+
+ The production UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue evaluates as follows:
+
+ 1. Let _ps_ be SourceText of |UnicodePropertyName|.
+ 1. Let _p_ be ! UnicodeMatchProperty(_ps_).
+ 1. Assert: _p_ is a Unicode property name or property alias listed in the “Property name and aliases” column of .
+ 1. Let _vs_ be SourceText of |UnicodePropertyValue|.
+ 1. Let _v_ be ! UnicodeMatchPropertyValue(_p_, _vs_).
+ 1. Return the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value _v_.
+
+ The production UnicodePropertyValueExpression :: LoneUnicodePropertyNameOrValue evaluates as follows:
+
+ 1. Let _s_ be SourceText of |LoneUnicodePropertyNameOrValue|.
+ 1. If ! UnicodeMatchPropertyValue(`General_Category`, _s_) is identical to a List of Unicode code points that is the name of a Unicode general category or general category alias listed in the “Property value and aliases” column of , then
+ 1. Return the CharSet containing all Unicode code points whose character database definition includes the property “General_Category” with value _s_.
+ 1. Let _p_ be ! UnicodeMatchProperty(_s_).
+ 1. Assert: _p_ is a binary Unicode property or binary property alias listed in the “Property name and aliases” column of .
+ 1. Return the CharSet containing all Unicode code points whose character database definition includes the property _p_ with value “True”.
+
+
+
+
+ CharacterEscape
+ The |CharacterEscape| productions evaluate as follows:
+
+ CharacterEscape ::
+ ControlEscape
+ `c` ControlLetter
+ `0` [lookahead ∉ DecimalDigit]
+ HexEscapeSequence
+ RegExpUnicodeEscapeSequence
+ IdentityEscape
+
+
+ 1. Let _cv_ be the CharacterValue of this |CharacterEscape|.
+ 1. Return the character whose character value is _cv_.
+
+
@@ -46127,26 +46136,23 @@ Regular Expressions
-
-
-
-
-
+
-
- Each `\\u` |HexTrailSurrogate| for which the choice of associated `u` |HexLeadSurrogate| is ambiguous shall be associated with the nearest possible `u` |HexLeadSurrogate| that would otherwise have no corresponding `\\u` |HexTrailSurrogate|.
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -46157,13 +46163,14 @@ Regular Expressions
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+