public class RegularExUtil extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
RegularExUtil() |
Modifier and Type | Method and Description |
---|---|
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
|
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
public static boolean match(String regularExpression, String inputText)
regularExpression
- regular expression that input must matchinputText
- value to comparepublic 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 sensitivepublic static String getReplacementRE(String oldValue, String newValue)
oldValue
- s/oldValue/newValue/g
- case-sensitive variantnewValue
- s/oldValue/newValue/gi
- case-insensitive variantpublic static String getMatchRE(String value)
value
- the inner value of the regexpublic static String getMatchRE(String value, boolean caseSensitive)
value
- the inner value of the regexcaseSensitive
- true if the match should be case sensitive, false otherwise