ParserJVM

weaponregex.parser.ParserJVM
class ParserJVM extends Parser

Concrete parser for JVM flavor of regex

Value parameters

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
class Parser
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def charClass[A : ParsingRun]: ParsingRun[CharacterClass]

Parse a character class

Parse a character class

Attributes

Returns

weaponregex.model.regextree.CharacterClass tree node

Example

"[abc]"

Definition Classes
override def charClassCharLiteralSpecialCases[A : ParsingRun]: ParsingRun[String]

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

Definition Classes
def charClassIntersection[A : ParsingRun]: ParsingRun[CharClassIntersection]

Parse a character class intersection used inside a character class.

Parse a character class intersection used inside a character class.

Attributes

Returns

weaponregex.model.regextree.CharClassIntersection tree node

Example

"abc&&[^bc]&&a-z"

def charClassNaked[A : ParsingRun]: ParsingRun[CharacterClassNaked]

Parse a character class content without the surround syntactical symbols, i.e. "naked"

Parse a character class content without the surround syntactical symbols, i.e. "naked"

Attributes

Returns

weaponregex.model.regextree.CharacterClassNaked tree node

Note
override def charOct[A : ParsingRun]: ParsingRun[MetaChar]

Parse a character with octal value \0n, \0nn, \0mnn (0 <= m <= 3, 0 <= n <= 7)

Parse a character with octal value \0n, \0nn, \0mnn (0 <= m <= 3, 0 <= n <= 7)

Attributes

Returns

weaponregex.model.regextree.MetaChar tree node

Example

"\012"

Definition Classes
override def specialConstruct[A : ParsingRun]: ParsingRun[RegexTree]

Intermediate parsing rule for special construct tokens which can parse either namedGroup, nonCapturingGroup, flagToggleGroup, flagNCGroup, lookaround or atomicGroup

Intermediate parsing rule for special construct tokens which can parse either namedGroup, nonCapturingGroup, flagToggleGroup, flagNCGroup, lookaround or atomicGroup

Attributes

Returns

weaponregex.model.regextree.RegexTree (sub)tree

Definition Classes

Inherited methods

def Indexed[A : ParsingRun, T](p: => ParsingRun[T]): ParsingRun[(Location, T)]

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
def RE[A : ParsingRun]: ParsingRun[RegexTree]

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

weaponregex.model.regextree.RegexTree tree

Example

any supported regex

Inherited from:
Parser
def anyDot[A : ParsingRun]: ParsingRun[AnyDot]

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
def atomicGroup[A : ParsingRun]: ParsingRun[AtomicGroup]

Parse an independent non-capturing group

Parse an independent non-capturing group

Attributes

Returns

weaponregex.model.regextree.AtomicGroup

Note

This is a Scala/Java-only regex syntax

Example

"(?>abc)"

Inherited from:
Parser
def basicRE[A : ParsingRun]: ParsingRun[RegexTree]

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
def bol[A : ParsingRun]: ParsingRun[BOL]

Parse a beginning of line character (^)

Parse a beginning of line character (^)

Attributes

Returns

weaponregex.model.regextree.BOL tree node

Example

"^"

Inherited from:
Parser
def boundary[A : ParsingRun]: ParsingRun[RegexTree]

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
def boundaryMetaChar[A : ParsingRun]: ParsingRun[Boundary]

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
def capturing[A : ParsingRun]: ParsingRun[RegexTree]

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
def charClassCharLiteral[A : ParsingRun]: ParsingRun[Character]

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
def charCodePoint[A : ParsingRun]: ParsingRun[MetaChar]

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
def charHex[A : ParsingRun]: ParsingRun[MetaChar]

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
def charLiteral[A : ParsingRun]: ParsingRun[Character]

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
def charLiteralSpecialCases[A : ParsingRun]: ParsingRun[String]

Parse special cases of a character literal

Parse special cases of a character literal

Attributes

Returns

The captured character as a string

Inherited from:
Parser
def charUnicode[A : ParsingRun]: ParsingRun[MetaChar]

Parse a unicode character \ uhhhh

Parse a unicode character \ uhhhh

Attributes

Returns

weaponregex.model.regextree.MetaChar tree node

Example

"\ u0020"

Inherited from:
Parser
def character[A : ParsingRun]: ParsingRun[RegexTree]

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
def classItem[A : ParsingRun]: ParsingRun[RegexTree]

Intermediate parsing rule for character class item tokens which can parse either charClass, preDefinedCharClass, metaCharacter, range, quoteChar, or charClassCharLiteral

Intermediate parsing rule for character class item tokens which can parse either charClass, preDefinedCharClass, metaCharacter, range, quoteChar, or charClassCharLiteral

Attributes

Returns

weaponregex.model.regextree.RegexTree (sub)tree

Inherited from:
Parser
def concat[A : ParsingRun]: ParsingRun[Concat]

Parse a concatenation of basicREs

Parse a concatenation of basicREs

Attributes

Returns

weaponregex.model.regextree.Concat tree node

Example

"abc"

Inherited from:
Parser
def controlChar[A : ParsingRun]: ParsingRun[ControlChar]

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
def elementaryRE[A : ParsingRun]: ParsingRun[RegexTree]

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

Inherited from:
Parser
def empty[A : ParsingRun]: ParsingRun[Empty]

Parse an empty string

Parse an empty string

Attributes

Returns

weaponregex.model.regextree.Empty tree node

Example

""

Inherited from:
Parser
def entry[A : ParsingRun]: ParsingRun[RegexTree]

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

weaponregex.model.regextree.RegexTree tree

Inherited from:
Parser
def eol[A : ParsingRun]: ParsingRun[EOL]

Parse a beginning of line character ($)

Parse a beginning of line character ($)

Attributes

Returns

weaponregex.model.regextree.EOL tree node

Example

"$"

Inherited from:
Parser
def escapeChar[A : ParsingRun]: ParsingRun[MetaChar]

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
def flagNCGroup[A : ParsingRun]: ParsingRun[FlagNCGroup]

Parse a non-capturing group with flags

Parse a non-capturing group with flags

Attributes

Returns

weaponregex.model.regextree.FlagNCGroup

Note

This is a Scala/Java-only regex syntax

Example

"(?id-mu:abc)"

Inherited from:
Parser
def flagToggle[A : ParsingRun](fs: String): ParsingRun[FlagToggle]

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
def flagToggleGroup[A : ParsingRun]: ParsingRun[FlagToggleGroup]

Parse a flag toggle group

Parse a flag toggle group

Attributes

Returns

weaponregex.model.regextree.FlagToggleGroup

Note

This is a Scala/Java-only regex syntax

Example

"(?id-mu)"

Inherited from:
Parser
def flags[A : ParsingRun](fs: String): ParsingRun[Flags]

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
def group[A : ParsingRun]: ParsingRun[Group]

Parse a capturing group

Parse a capturing group

Attributes

Returns

weaponregex.model.regextree.Group tree node

Example

"(a)"

Inherited from:
Parser
def groupName[A : ParsingRun]: ParsingRun[String]

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
def hexDigit[A : ParsingRun]: ParsingRun[String]

Parse a single hexadecimal digit

Parse a single hexadecimal digit

Attributes

Returns

the parsed hexadecimal digit as a String

Example

"F"

Inherited from:
Parser
def hexEscCharConsumer[A : ParsingRun]: ParsingRun[RegexTree]

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
def lookaround[A : ParsingRun]: ParsingRun[Lookaround]

Parse a positive or negative lookahead or lookbehind

Parse a positive or negative lookahead or lookbehind

Attributes

Returns

weaponregex.model.regextree.Lookaround

Example

"(?=abc)" (positive lookahead)

Inherited from:
Parser
def metaCharacter[A : ParsingRun]: ParsingRun[RegexTree]

Intermediate parsing rule for meta-character tokens which can parse either charOct, charHex, charUnicode, charHexBrace or escapeChar

Intermediate parsing rule for meta-character tokens which can parse either charOct, charHex, charUnicode, charHexBrace or escapeChar

Attributes

Returns

weaponregex.model.regextree.RegexTree (sub)tree

Inherited from:
Parser
def nameReference[A : ParsingRun]: ParsingRun[NameReference]

Parse a reference to a named capturing group

Parse a reference to a named capturing group

Attributes

Returns

weaponregex.model.regextree.NameReference

Example

"\k<name1>"

Inherited from:
Parser
def namedGroup[A : ParsingRun]: ParsingRun[NamedGroup]

Parse a named-capturing group

Parse a named-capturing group

Attributes

Returns

weaponregex.model.regextree.NamedGroup tree node

Example

"(?<name1>hello)"

Inherited from:
Parser
def nonCapturingGroup[A : ParsingRun]: ParsingRun[Group]

Parse a non-capturing group

Parse a non-capturing group

Attributes

Returns

weaponregex.model.regextree.Group tree node

Example

"(?:hello)"

Inherited from:
Parser
def numReference[A : ParsingRun]: ParsingRun[NumberReference]

Parse a numbered reference to a capture group

Parse a numbered reference to a capture group

Attributes

Returns

weaponregex.model.regextree.NumberReference

Example

"\13"

Inherited from:
Parser
def number[A : ParsingRun]: ParsingRun[Int]

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
def or[A : ParsingRun]: ParsingRun[Or]

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
def parse: Either[String, RegexTree]

Parse the given regex pattern

Parse the given regex pattern

Attributes

Returns

A Right of parsed weaponregex.model.regextree.RegexTree if can be parsed, a Left with the error message otherwise

Inherited from:
Parser
def posixCharClass[A : ParsingRun]: ParsingRun[POSIXCharClass]

Parse a posix character class

Parse a posix character class

Attributes

Returns

weaponregex.model.regextree.POSIXCharClass tree node

Note

This does not check for the validity of the property inside \p{}

Example

"\p{Alpha}"

Inherited from:
Parser
def preDefinedCharClass[A : ParsingRun]: ParsingRun[PredefinedCharClass]

Parse a predefined character class

Parse a predefined character class

Attributes

Returns

weaponregex.model.regextree.PredefinedCharClass tree node

See also
Example

"\d"

Inherited from:
Parser
def quantifier[A : ParsingRun]: ParsingRun[RegexTree]

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
def quantifierLong[A : ParsingRun]: ParsingRun[Quantifier]

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
def quantifierLongTail[A : ParsingRun]: ParsingRun[(Int, Option[Option[Int]])]

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
def quantifierShort[A : ParsingRun]: ParsingRun[RegexTree]

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
def quantifierType[A : ParsingRun, T](p: => ParsingRun[T]): ParsingRun[(T, QuantifierType)]

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
def quote[A : ParsingRun]: ParsingRun[RegexTree]

Intermediate parsing rule for quoting tokens which can parse either quoteLong or quoteChar

Intermediate parsing rule for quoting tokens which can parse either quoteLong or quoteChar

Attributes

Returns

weaponregex.model.regextree.RegexTree (sub)tree

Inherited from:
Parser
def quoteChar[A : ParsingRun]: ParsingRun[QuoteChar]

Parse a quoted character (any character)

Parse a quoted character (any character)

Attributes

Returns

weaponregex.model.regextree.QuoteChar

Example

"$"

Inherited from:
Parser
def quoteLong[A : ParsingRun]: ParsingRun[Quote]

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
def range[A : ParsingRun]: ParsingRun[Range]

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
def reference[A : ParsingRun]: ParsingRun[RegexTree]

Intermediate parsing rule for reference tokens which can parse either nameReference or numReference

Intermediate parsing rule for reference tokens which can parse either nameReference or numReference

Attributes

Returns

weaponregex.model.regextree.RegexTree (sub)tree

Inherited from:
Parser
def simpleRE[A : ParsingRun]: ParsingRun[RegexTree]

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

Concrete fields

override val boundaryMetaChars: String

Allowed boundary meta-characters

Allowed boundary meta-characters

Attributes

override val charClassSpecialChars: String

Special characters within a character class

Special characters within a character class

Attributes

override val codePointEscChar: String

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}

override val escapeChars: String

Allowed escape characters

Allowed escape characters

Attributes

override val minCharClassItem: Int

Minimum number of character class items of a valid character class

Minimum number of character class items of a valid character class

Attributes

override val predefCharClassChars: String

Allowed predefined character class characters

Allowed predefined character class characters

Attributes

override val specialChars: String

Regex special characters

Regex special characters

Attributes