|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccs.utils.Regex
public class Regex
A Regular Expression matcher with a simpilified syntax and limited functionality. The only special characters are ? (match exactly one character) and * (match 0 or more characters). * is "greedy" - it will match as many characters as it can, but will back off as required for the match to succeed. In general this behaviour gives the results you'd expect.
Historically this class implemented the matching itself; however, Java 1.4 provides a full-featured PERL-compatible Regex system with much better performance, so this class has been re-written as a wrapper around that.
Constructor Summary | |
---|---|
Regex(java.lang.String pattern,
boolean isSense)
Create a Regex which matches the given pattern. |
Method Summary | |
---|---|
java.lang.String |
getPattern()
Returns the pattern. |
boolean |
getSense()
Returns whether matching is case-sensitive. |
boolean |
matches(java.lang.String a)
Returns whether the given string matches the current pattern, with default case-sensitivity. |
static java.lang.String |
translate(java.lang.String src)
Translate the simplified regex syntax used by this class into PERL5 regex syntax. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Regex(java.lang.String pattern, boolean isSense)
pattern
- The pattern to match.isSense
- whether to perform a case-sensitive match.Method Detail |
---|
public java.lang.String getPattern()
public boolean getSense()
public boolean matches(java.lang.String a)
a
- The string to check.
public static java.lang.String translate(java.lang.String src)
src
- The pattern in simplified syntax.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |