public class RegexMatch
extends java.lang.Object
SymbolID
against regular expressions.
This class used to use reflection to avoid a compile type dependence
on java.util.regex. Now, we assume java.util.regex is available.Constructor and Description |
---|
RegexMatch(java.lang.String regex)
Create a regular expression matching object.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
hasRegex()
Return
true iff the current runtime system has regular
expression support. |
boolean |
match(SymbolID id)
Return
true if the SymbolID matches the
compiled regular expression. |
public RegexMatch(java.lang.String regex) throws RegexUnsupportedException, java.util.regex.PatternSyntaxException
regex
- a regular expression to be compiled.RegexUnsupportedException
- this exception
indicates that the runtime environment lacks the necessary.BadRegexException
- this exception
indicates that the regular expression had a syntax error. The message
tries to indicate where the error occured.java.util.regex.PatternSyntaxException