gov.llnl.babel.symbols
Class RegexMatch
java.lang.Object
gov.llnl.babel.symbols.RegexMatch
public class RegexMatch
extends java.lang.Object
Provide regular expression matching for
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.
RegexMatch(String regex) - Create a regular expression matching object.
|
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.
|
RegexMatch
public RegexMatch(String regex)
throws RegexUnsupportedException,
PatternSyntaxException
Create a regular expression matching object.
regex
- a regular expression to be compiled.
hasRegex
public static boolean hasRegex()
Return true
iff the current runtime system has regular
expression support.
match
public boolean match(SymbolID id)
Return
true
if the
SymbolID
matches the
compiled regular expression.
id
- the symbol that will be compared with the regular
expression.
true
indicates that the SymbolID
matches
the regular expression.