Class RegexHelper
- java.lang.Object
-
- com.smartgridready.communicator.common.helper.RegexHelper
-
public class RegexHelper extends java.lang.ObjectProvides Regular expression helper methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanmatch(java.lang.String regex, java.lang.String str)Matches a string.static Valuequery(java.lang.String regex, java.lang.String str)Extracts a substring using a regular expression.
-
-
-
Method Detail
-
match
public static boolean match(java.lang.String regex, java.lang.String str)Matches a string.- Parameters:
regex- the regular expressionstr- the input string- Returns:
- true if matches, false otherwise
-
query
public static Value query(java.lang.String regex, java.lang.String str)
Extracts a substring using a regular expression.- Parameters:
regex- the regular expressionstr- the input string- Returns:
- an instance of
StringValue
-
-