|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mentaregex.Regex
public class Regex
A perl-like regex support for Java.
| Constructor Summary | |
|---|---|
Regex(String s,
String pattern)
Creates a new regex expression. |
|
Regex(String s,
String pattern,
char escape)
Creates a new regex expression. |
|
| Method Summary | |
|---|---|
static String |
escapeSlash(String s,
String escapeChar)
Escape a forward slash with the escape char provided. |
String[] |
match()
Match and return what was matched. |
static String[] |
match(String s,
String pattern)
Fast way to match. |
static String[] |
match(String s,
String pattern,
char escapeChar)
Fast way to match. |
boolean |
matches()
Tell whether there is a match for this regex. |
static boolean |
matches(String s,
String pattern)
Fast way to match. |
static boolean |
matches(String s,
String pattern,
char escapeChar)
Fast way to match. |
static String |
sub(String s,
String pattern)
Fast way to substitute. |
static String |
sub(String s,
String pattern,
char escapeChar)
Fast way to substitute. |
String |
substitute()
Substitute and return the new string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Regex(String s,
String pattern,
char escape)
s - The string to be matched or substitutedpattern - The regex patternescape - The escape char to use
public Regex(String s,
String pattern)
s - The string to be matched or substitutedpattern - The regex pattern| Method Detail |
|---|
public String substitute()
public boolean matches()
public String[] match()
public static String[] match(String s,
String pattern)
s - The string to matchpattern - The regex pattern to match
public static boolean matches(String s,
String pattern)
s - The string to matchpattern - The regex pattern to match
public static String[] match(String s,
String pattern,
char escapeChar)
s - The string to matchpattern - The regex pattern to matchescapeChar - the escape char to use
public static boolean matches(String s,
String pattern,
char escapeChar)
s - The string to matchpattern - The regex pattern to matchescapeChar - the escape char to use
public static String sub(String s,
String pattern)
s - The string to substitutepattern - the pattern to match
public static String sub(String s,
String pattern,
char escapeChar)
s - The string to substitutepattern - the pattern to matchescapeChar - the scape char to use
public static String escapeSlash(String s,
String escapeChar)
s - The string to changeescapeChar - the escape char to use
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||