ParserJS
Concrete parser for JS flavor of regex
Value parameters
- flags
-
The regex flags to be used
- pattern
-
The regex pattern to be parsed
Attributes
- See also
- Note
-
This class constructor is private, instances must be created using the companion weaponregex.parser.Parser object
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Parse special cases of a character literal
Parse special cases of a character literal
Attributes
- Returns
-
The captured character as a string
- Definition Classes
Parse a character with octal value \n
, \nn
, \mnn
(0 <= m,n <= 9)
Parse a character with octal value \n
, \nn
, \mnn
(0 <= m,n <= 9)
Attributes
- Returns
-
weaponregex.model.regextree.MetaChar tree node
- Note
-
This syntax will correctly match if 0 <= m <= 3, 0 <= n <= 7; but m and/or n outside of this range will still be parsable.
- Example
-
"\012"
- Definition Classes
Intermediate parsing rule for character class item tokens which can parse either preDefinedCharClass
, metaCharacter
, range
, quoteChar
, or charClassCharLiteral
Intermediate parsing rule for character class item tokens which can parse either preDefinedCharClass
, metaCharacter
, range
, quoteChar
, or charClassCharLiteral
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Note
-
Nested character class is a Scala/Java-only regex syntax
- Definition Classes
Intermediate parsing rule which can parse either capturing
, anyDot
, preDefinedCharClass
, boundary
, charClass
, reference
, character
or quote
Intermediate parsing rule which can parse either capturing
, anyDot
, preDefinedCharClass
, boundary
, charClass
, reference
, character
or quote
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Definition Classes
Intermediate parsing rule for meta-character tokens which can parse either charOct
, charHex
, charUnicode
or escapeChar
Intermediate parsing rule for meta-character tokens which can parse either charOct
, charHex
, charUnicode
or escapeChar
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Definition Classes
Parse a quoted character (any character). If unicodeMode is true, only the following characters are allowed: ^ $ \ . * + ? ( ) [ ] { } |
or /
Parse a quoted character (any character). If unicodeMode is true, only the following characters are allowed: ^ $ \ . * + ? ( ) [ ] { } |
or /
Attributes
- Returns
- Example
-
"$"
- Definition Classes
Intermediate parsing rule for reference tokens which can parse only nameReference
Intermediate parsing rule for reference tokens which can parse only nameReference
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Definition Classes
Inherited methods
A higher order parser that add weaponregex.model.Location index information of the parse of the given parser
A higher order parser that add weaponregex.model.Location index information of the parse of the given parser
Value parameters
- p
-
the parser to be indexed
Attributes
- Returns
-
A tuple of the weaponregex.model.Location of the parse, and the return of the given parser
p
- Inherited from:
- Parser
The top-level parsing rule which can parse either or
or simpleRE
The top-level parsing rule which can parse either or
or simpleRE
Attributes
- Returns
- Example
-
any supported regex
- Inherited from:
- Parser
Parse an any(dot) (.
) predefined character class
Parse an any(dot) (.
) predefined character class
Attributes
- Returns
-
weaponregex.model.regextree.AnyDot tree node
- Example
-
"."
- Inherited from:
- Parser
Parse an independent non-capturing group
Parse an independent non-capturing group
Attributes
- Returns
- Note
-
This is a Scala/Java-only regex syntax
- Example
-
"(?>abc)"
- Inherited from:
- Parser
Intermediate parsing rule which can parse either quantifier
or elementaryRE
Intermediate parsing rule which can parse either quantifier
or elementaryRE
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Parse a beginning of line character (^
)
Parse a beginning of line character (^
)
Attributes
- Returns
-
weaponregex.model.regextree.BOL tree node
- Example
-
"^"
- Inherited from:
- Parser
Intermediate parsing rule for boundary tokens which can parse either bol
, eol
or boundaryMetaChar
Intermediate parsing rule for boundary tokens which can parse either bol
, eol
or boundaryMetaChar
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Parse a boundary meta-character character
Parse a boundary meta-character character
Attributes
- Returns
-
weaponregex.model.regextree.BOL tree node
- See also
- Example
-
"\z"
- Inherited from:
- Parser
Intermediate parsing rule for capturing-related tokens which can parse either group
or specialConstruct
Intermediate parsing rule for capturing-related tokens which can parse either group
or specialConstruct
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Parse a character class
Parse a single literal character that is allowed to be in a character class
Parse a single literal character that is allowed to be in a character class
Attributes
- Returns
-
weaponregex.model.regextree.Character tree node
- See also
- Example
-
"{"
- Inherited from:
- Parser
Parse special cases of a character literal in a character class
Parse special cases of a character literal in a character class
Attributes
- Returns
-
The captured character as a string
- Inherited from:
- Parser
Parse a character with a code point \x{h...h}
, where Character.MIN_CODE_POINT <= 0xh...h <= Character.MAX_CODE_POINT and x is weaponregex.parser.Parser#codePointEscChar
Parse a character with a code point \x{h...h}
, where Character.MIN_CODE_POINT <= 0xh...h <= Character.MAX_CODE_POINT and x is weaponregex.parser.Parser#codePointEscChar
Attributes
- Returns
-
weaponregex.model.regextree.MetaChar tree node
- See also
- Example
-
"\ x{0123}"
or"\ u{0123}"
- Inherited from:
- Parser
Parse a character with hexadecimal value \xhh
Parse a character with hexadecimal value \xhh
Attributes
- Returns
-
weaponregex.model.regextree.MetaChar tree node
- Example
-
"\x01"
- Inherited from:
- Parser
Parse a single literal character that is not a regex special character
Parse a single literal character that is not a regex special character
Attributes
- Returns
-
weaponregex.model.regextree.Character tree node
- See also
- Example
-
"a"
- Inherited from:
- Parser
Parse a unicode character \ uhhhh
Parse a unicode character \ uhhhh
Attributes
- Returns
-
weaponregex.model.regextree.MetaChar tree node
- Example
-
"\ u0020"
- Inherited from:
- Parser
Intermediate parsing rule for character-related tokens which can parse either metaCharacter
or charLiteral
Intermediate parsing rule for character-related tokens which can parse either metaCharacter
or charLiteral
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Parse a concatenation of basicRE
s
Parse a concatenation of basicRE
s
Attributes
- Returns
-
weaponregex.model.regextree.Concat tree node
- Example
-
"abc"
- Inherited from:
- Parser
Parse an control meta-character based on caret notation
Parse an control meta-character based on caret notation
Attributes
- Returns
-
weaponregex.model.regextree.ControlChar tree node
- See also
- Example
-
"\cA"
- Inherited from:
- Parser
Parse an empty string
Parse an empty string
Attributes
- Returns
-
weaponregex.model.regextree.Empty tree node
- Example
-
""
- Inherited from:
- Parser
The entry point of the parser that should parse from the start to the end of the regex string
The entry point of the parser that should parse from the start to the end of the regex string
Attributes
- Returns
- Inherited from:
- Parser
Parse a beginning of line character ($
)
Parse a beginning of line character ($
)
Attributes
- Returns
-
weaponregex.model.regextree.EOL tree node
- Example
-
"$"
- Inherited from:
- Parser
Parse an escape meta-character
Parse an escape meta-character
Attributes
- Returns
-
weaponregex.model.regextree.MetaChar tree node
- See also
- Example
-
"\n"
- Inherited from:
- Parser
Parse a non-capturing group with flags
Parse a non-capturing group with flags
Attributes
- Returns
- Note
-
This is a Scala/Java-only regex syntax
- Example
-
"(?id-mu:abc)"
- Inherited from:
- Parser
Parse a flag toggle (idmsuxU-idmsuxU
)
Parse a flag toggle (idmsuxU-idmsuxU
)
Attributes
- Returns
-
weaponregex.model.regextree.FlagToggle tree node
- Note
-
This is a Scala/Java-only regex syntax
- Example
-
"idmsuxU-idmsuxU"
- Inherited from:
- Parser
Parse a flag toggle group
Parse a flag toggle group
Attributes
- Returns
- Note
-
This is a Scala/Java-only regex syntax
- Example
-
"(?id-mu)"
- Inherited from:
- Parser
Parse flag literal characters given a string contains all allowed flags
Parse flag literal characters given a string contains all allowed flags
Value parameters
- fs
-
The string contains all allowed flags
Attributes
- Returns
-
weaponregex.model.regextree.Flags tree node
- Note
-
This is a Scala/Java-only regex syntax
- Example
-
"idmsuxU"
- Inherited from:
- Parser
Parse a capturing group
Parse a capturing group
Attributes
- Returns
-
weaponregex.model.regextree.Group tree node
- Example
-
"(a)"
- Inherited from:
- Parser
Parse a group name that starts with a letter and followed by zero or more alphanumeric characters
Parse a group name that starts with a letter and followed by zero or more alphanumeric characters
Attributes
- Returns
-
the parsed name string
- Example
-
"name1"
- Inherited from:
- Parser
Parse a single hexadecimal digit
Parse a single hexadecimal digit
Attributes
- Returns
-
the parsed hexadecimal digit as a
String
- Example
-
"F"
- Inherited from:
- Parser
Used to consume a hexadecimal escape character \ x
or \ u
when all other hex related cases are checked and failed to prevent back tracking.
Used to consume a hexadecimal escape character \ x
or \ u
when all other hex related cases are checked and failed to prevent back tracking.
Attributes
- Returns
-
a
null
dummy - Inherited from:
- Parser
Parse a positive or negative lookahead or lookbehind
Parse a positive or negative lookahead or lookbehind
Attributes
- Returns
- Example
-
"(?=abc)"
(positive lookahead) - Inherited from:
- Parser
Parse a reference to a named capturing group
Parse a reference to a named capturing group
Attributes
- Returns
- Example
-
"\k<name1>"
- Inherited from:
- Parser
Parse a named-capturing group
Parse a named-capturing group
Attributes
- Returns
-
weaponregex.model.regextree.NamedGroup tree node
- Example
-
"(?<name1>hello)"
- Inherited from:
- Parser
Parse a non-capturing group
Parse a non-capturing group
Attributes
- Returns
-
weaponregex.model.regextree.Group tree node
- Example
-
"(?:hello)"
- Inherited from:
- Parser
Parse a numbered reference to a capture group
Parse a numbered reference to a capture group
Attributes
- Returns
- Example
-
"\13"
- Inherited from:
- Parser
Parse an integer with any number of digits between 0 and 9
Parse an integer with any number of digits between 0 and 9
Attributes
- Returns
-
the parsed integer
- Example
-
"123"
- Inherited from:
- Parser
Parse an 'or' (|
) of simpleRE
Parse an 'or' (|
) of simpleRE
Attributes
- Returns
-
weaponregex.model.regextree.Or tree node
- Example
-
"a|b|c"
- Inherited from:
- Parser
Parse the given regex pattern
Parse the given regex pattern
Attributes
- Returns
-
A
Right
of parsed weaponregex.model.regextree.RegexTree if can be parsed, aLeft
with the error message otherwise - Inherited from:
- Parser
Parse a posix character class
Parse a posix character class
Attributes
- Returns
- Note
-
This does not check for the validity of the property inside
\p{}
- Example
-
"\p{Alpha}"
- Inherited from:
- Parser
Parse a predefined character class
Intermediate parsing rule for quantifier tokens which can parse either quantifierShort
or quantifierLong
Intermediate parsing rule for quantifier tokens which can parse either quantifierShort
or quantifierLong
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Parse a (full) quantifier ({n}
, {n,}
, {n,m}
)
Parse a (full) quantifier ({n}
, {n,}
, {n,m}
)
Attributes
- Returns
-
weaponregex.model.regextree.Quantifier tree node
- Example
-
"a{1}"
- Inherited from:
- Parser
Parse the tail part of a long quantifier
Parse the tail part of a long quantifier
Attributes
- Returns
-
A tuple of the quantifier minimum and optional maximum part
- Inherited from:
- Parser
Parse a shorthand notation for quantifier (?
, *
, +
)
Parse a shorthand notation for quantifier (?
, *
, +
)
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Example
-
"a*"
- Inherited from:
- Parser
A higher order parser that add weaponregex.model.regextree.QuantifierType information of the parse of the given (quantifier) parser
A higher order parser that add weaponregex.model.regextree.QuantifierType information of the parse of the given (quantifier) parser
Value parameters
- p
-
the quantifier parser
Attributes
- Returns
-
A tuple of the return of the given (quantifier) parser
p
, and its weaponregex.model.regextree.QuantifierType - Inherited from:
- Parser
Parse a quoted character (any character)
Parse a 'long' quote, using \Q
and \E
Parse a 'long' quote, using \Q
and \E
Attributes
- Returns
-
weaponregex.model.regextree.Quote tree node
- Example
-
"\Qquoted\E"
- Inherited from:
- Parser
Parse a character range inside a character class
Parse a character range inside a character class
Attributes
- Returns
-
weaponregex.model.regextree.Range tree node
- Example
-
"a-z"
- Inherited from:
- Parser
Intermediate parsing rule which can parse either concat
, basicRE
or empty
Intermediate parsing rule which can parse either concat
, basicRE
or empty
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Intermediate parsing rule for special construct tokens which can parse either namedGroup
, nonCapturingGroup
or lookaround
Intermediate parsing rule for special construct tokens which can parse either namedGroup
, nonCapturingGroup
or lookaround
Attributes
- Returns
-
weaponregex.model.regextree.RegexTree (sub)tree
- Inherited from:
- Parser
Concrete fields
Allowed boundary meta-characters
Allowed boundary meta-characters
Attributes
Special characters within a character class
Special characters within a character class
Attributes
The escape character used with a code point
The escape character used with a code point
Attributes
- Example
-
\ x{h..h}
or\ u{h..h}
Allowed escape characters
Allowed escape characters
Attributes
Minimum number of character class items of a valid character class
Minimum number of character class items of a valid character class
Attributes
Allowed predefined character class characters
Allowed predefined character class characters
Attributes
Regex special characters
Regex special characters