public abstract class RegExpTokenMatcher extends java.lang.Object implements TokenBuilder
Pattern
,
Serialized FormConstructor and Description |
---|
RegExpTokenMatcher(java.util.regex.Pattern pattern)
A token matcher which matches a specified of pattern.
|
RegExpTokenMatcher(java.lang.String regex)
A token matcher which matches a regular expression of pattern.
|
Modifier and Type | Method and Description |
---|---|
abstract Token |
buildToken(java.lang.String s)
Builds a token following a successful match.
|
Token |
match(java.lang.String s)
Attempts to match the start of the string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init
public RegExpTokenMatcher(java.util.regex.Pattern pattern)
pattern
- Pattern to matchpublic RegExpTokenMatcher(java.lang.String regex)
regex
- the expression to matchpublic Token match(java.lang.String s)
match
in interface TokenMatcher
s
- the string to match againstpublic abstract Token buildToken(java.lang.String s)
buildToken
in interface TokenBuilder
s
- String representing the completed matched tokenCopyright © 2018 Singular Systems http://www.singularsys.com/jep