|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.common.RegularExUtil
public class RegularExUtil
Base regex utility class containing constant variables for starting and ending regex searches. Gives basic methods for search, match, and replace.
Field Summary | |
---|---|
static String |
RE_BACK_DASH
Base backslash |
static String |
RE_MATCH_CASEINSENSITIVE
Make the match case in sensitive |
static String |
RE_MATCH_END
End of match for regular expression |
static String |
RE_MATCH_START
Start match for regular expression |
static String |
RE_SUBST_END
Subset end of regular expression |
static String |
RE_SUBST_START
Subset start regular expression |
Constructor Summary | |
---|---|
RegularExUtil()
|
Method Summary | |
---|---|
static String |
getMatchRE(String value)
Prepare RE for Perl5Util.match() call. |
static String |
getMatchRE(String value,
boolean caseSensitive)
Prepare RE for Perl5Util.match() call |
static String |
getReplacementRE(String oldValue,
String newValue)
Prepare RE for Perl5Util.substitute() call in the form |
static boolean |
match(String regularExpression,
String inputText)
Returns true if the input text matches the regular expression with case insensitive |
static boolean |
match(String regularExpression,
String inputText,
boolean caseInsensitve)
Returns true if the input text matches the regular expression with either case sensitive or case insensitive |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RE_BACK_DASH
public static final String RE_SUBST_START
public static final String RE_SUBST_END
public static final String RE_MATCH_START
public static final String RE_MATCH_END
public static final String RE_MATCH_CASEINSENSITIVE
Constructor Detail |
---|
public RegularExUtil()
Method Detail |
---|
public static boolean match(String regularExpression, String inputText)
regularExpression
- regular expression that input must matchinputText
- value to compare
public static boolean match(String regularExpression, String inputText, boolean caseInsensitve)
regularExpression
- regular expression that input must matchinputText
- value to comparecaseInsensitve
- true if we care about case sensitive
public static String getReplacementRE(String oldValue, String newValue)
oldValue
- s/oldValue/newValue/g
- case-sensitive variantnewValue
- s/oldValue/newValue/gi
- case-insensitive variant
public static String getMatchRE(String value)
value
- the inner value of the regex
public static String getMatchRE(String value, boolean caseSensitive)
value
- the inner value of the regexcaseSensitive
- true if the match should be case sensitive, false otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |