Package snap.parse
Class Regex
java.lang.Object
snap.parse.Regex
A class for building regular expressions like a string buffer.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchar
Returns the first literal in regex pattern (or 0 if not literal).int
Returns the literal length of this regex (the number of literal chars in the prefix).Returns the shared matcher.getName()
Returns the regex name.Returns the regex pattern.Returns the compiled pattern.boolean
Returns whether pattern is literal.boolean
isMatchingStartChar
(char aChar, String charStr) Returns whether given regex matches given start char.toString()
Returns a string representation of regex.
-
Constructor Details
-
Regex
Constructor with given pattern and name.
-
-
Method Details
-
getName
Returns the regex name. -
getPattern
Returns the regex pattern. -
isLiteral
public boolean isLiteral()Returns whether pattern is literal. -
getPatternCompiled
Returns the compiled pattern. -
getMatcher
Returns the shared matcher. -
getLiteralLength
public int getLiteralLength()Returns the literal length of this regex (the number of literal chars in the prefix). -
getLiteralChar
public char getLiteralChar()Returns the first literal in regex pattern (or 0 if not literal). -
isMatchingStartChar
Returns whether given regex matches given start char. -
toString
Returns a string representation of regex.
-