Package org.craftercms.commons.lang
Class RegexUtils
- java.lang.Object
-
- org.craftercms.commons.lang.RegexUtils
-
public class RegexUtils extends Object
Utility methods for regex related operations.- Author:
- avasquez
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
matchesAny(String str, String... regexes)
Returns true if the string matches any of the specified regexes.static boolean
matchesAny(String str, List<String> regexes)
Returns true if the string matches (full match) any of the specified regexes.static boolean
matchesAny(String str, List<String> regexes, boolean fullMatch)
Returns true if the string matches any of the specified regexes.
-
-
-
Method Detail
-
matchesAny
public static boolean matchesAny(String str, String... regexes)
Returns true if the string matches any of the specified regexes.- Parameters:
str
- the string to matchregexes
- the regexes used for matching- Returns:
- true if the string matches one or more of the regexes
-
matchesAny
public static boolean matchesAny(String str, List<String> regexes)
Returns true if the string matches (full match) any of the specified regexes.- Parameters:
str
- the string to matchregexes
- the regexes used for matching- Returns:
- true if the string matches (full match) one or more of the regexes
-
matchesAny
public static boolean matchesAny(String str, List<String> regexes, boolean fullMatch)
Returns true if the string matches any of the specified regexes.- Parameters:
str
- the string to matchregexes
- the regexes used for matchingfullMatch
- if the entire string should be matched- Returns:
- true if the string matches one or more of the regexes
-
-