Class RegexUtils

java.lang.Object
org.craftercms.commons.lang.RegexUtils

public class RegexUtils extends Object
Utility methods for regex related operations.
Author:
avasquez
  • Method Details

    • 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 match
      regexes - 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 match
      regexes - 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 match
      regexes - the regexes used for matching
      fullMatch - if the entire string should be matched
      Returns:
      true if the string matches one or more of the regexes