A.8 Regular Expressions

Pattern[U, N] :: Disjunction[?U, ?N] Disjunction[U, N] :: Alternative[?U, ?N] Alternative[?U, ?N] | Disjunction[?U, ?N] Alternative[U, N] :: [empty] Alternative[?U, ?N] Term[?U, ?N] Term[U, N] :: Assertion[?U, ?N] Atom[?U, ?N] Atom[?U, ?N] Quantifier Assertion[U, N] :: ^ $ \ b \ B ( ? = Disjunction[?U, ?N] ) ( ? ! Disjunction[?U, ?N] ) ( ? <= Disjunction[?U, ?N] ) ( ? <! Disjunction[?U, ?N] ) Quantifier :: QuantifierPrefix QuantifierPrefix ? QuantifierPrefix :: * + ? { DecimalDigits[~Sep] } { DecimalDigits[~Sep] , } { DecimalDigits[~Sep] , DecimalDigits[~Sep] } Atom[U, N] :: PatternCharacter . \ AtomEscape[?U, ?N] CharacterClass[?U] ( GroupSpecifier[?U] Disjunction[?U, ?N] ) ( ? : Disjunction[?U, ?N] ) SyntaxCharacter :: one of ^ $ \ . * + ? ( ) [ ] { } | PatternCharacter :: SourceCharacter but not SyntaxCharacter AtomEscape[U, N] :: DecimalEscape CharacterClassEscape[?U] CharacterEscape[?U] [+N] k GroupName[?U] CharacterEscape[U] :: ControlEscape c ControlLetter 0 [lookahead ∉ DecimalDigit] HexEscapeSequence RegExpUnicodeEscapeSequence[?U] IdentityEscape[?U] ControlEscape :: one of f n r t v ControlLetter :: one of a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z GroupSpecifier[U] :: [empty] ? GroupName[?U] GroupName[U] :: < RegExpIdentifierName[?U] > RegExpIdentifierName[U] :: RegExpIdentifierStart[?U] RegExpIdentifierName[?U] RegExpIdentifierPart[?U] RegExpIdentifierStart[U] :: UnicodeIDStart $ _ \ RegExpUnicodeEscapeSequence[+U] [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate RegExpIdentifierPart[U] :: UnicodeIDContinue $ \ RegExpUnicodeEscapeSequence[+U] [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate <ZWNJ> <ZWJ> RegExpUnicodeEscapeSequence[U] :: [+U] u HexLeadSurrogate \u HexTrailSurrogate [+U] u HexLeadSurrogate [+U] u HexTrailSurrogate [+U] u HexNonSurrogate [~U] u Hex4Digits [+U] u{ CodePoint } UnicodeLeadSurrogate :: any Unicode code point in the inclusive range 0xD800 to 0xDBFF UnicodeTrailSurrogate :: any Unicode code point in the inclusive range 0xDC00 to 0xDFFF

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.

 

HexLeadSurrogate :: Hex4Digits but only if the MV of Hex4Digits is in the inclusive range 0xD800 to 0xDBFF HexTrailSurrogate :: Hex4Digits but only if the MV of Hex4Digits is in the inclusive range 0xDC00 to 0xDFFF HexNonSurrogate :: Hex4Digits but only if the MV of Hex4Digits is not in the inclusive range 0xD800 to 0xDFFF IdentityEscape[U] :: [+U]SyntaxCharacter [+U]/ [~U]SourceCharacter but not UnicodeIDContinue DecimalEscape :: NonZeroDigit DecimalDigits[~Sep]opt [lookahead ∉ DecimalDigit] CharacterClassEscape[U] :: d D s S w W [+U] p{ UnicodePropertyValueExpression } [+U] P{ UnicodePropertyValueExpression } UnicodePropertyValueExpression :: UnicodePropertyName = UnicodePropertyValue LoneUnicodePropertyNameOrValue UnicodePropertyName :: UnicodePropertyNameCharacters UnicodePropertyNameCharacters :: UnicodePropertyNameCharacter UnicodePropertyNameCharactersopt UnicodePropertyValue :: UnicodePropertyValueCharacters LoneUnicodePropertyNameOrValue :: UnicodePropertyValueCharacters UnicodePropertyValueCharacters :: UnicodePropertyValueCharacter UnicodePropertyValueCharactersopt UnicodePropertyValueCharacter :: UnicodePropertyNameCharacter DecimalDigit UnicodePropertyNameCharacter :: ControlLetter _ CharacterClass[U] :: [ [lookahead ≠ ^] ClassRanges[?U] ] [ ^ ClassRanges[?U] ] ClassRanges[U] :: [empty] NonemptyClassRanges[?U] NonemptyClassRanges[U] :: ClassAtom[?U] ClassAtom[?U] NonemptyClassRangesNoDash[?U] ClassAtom[?U] - ClassAtom[?U] ClassRanges[?U] NonemptyClassRangesNoDash[U] :: ClassAtom[?U] ClassAtomNoDash[?U] NonemptyClassRangesNoDash[?U] ClassAtomNoDash[?U] - ClassAtom[?U] ClassRanges[?U] ClassAtom[U] :: - ClassAtomNoDash[?U] ClassAtomNoDash[U] :: SourceCharacter but not one of \ or ] or - \ ClassEscape[?U] ClassEscape[U] :: b [+U]- CharacterClassEscape[?U] CharacterEscape[?U]