Interface IRegexUtils


public interface IRegexUtils
Utility bean used to run regular expression in velocity.
Author:
Fernando Boucquez
  • Method Summary

    Modifier and Type
    Method
    Description
    extractAllValues(String text, String... regexes)
    Extracts all the values from all the regular expressions.
    extractValue(String text, String... regexes)
    Extracts the first value that is extracted from one of the regular expressions.
    boolean
    matchesAny(String text, String... regexes)
    Evaluates if text matches at least one of the regular expressions (one or multiple can be provided)
  • Method Details

    • matchesAny

      boolean matchesAny(String text, String... regexes)
      Evaluates if text matches at least one of the regular expressions (one or multiple can be provided)
      Parameters:
      text - the text to be evaluated
      regexes - the regexes, one or many could be provided. Note that .* terms cannot be used.
      Returns:
      if the text matches at least one of the provided regular expressions.
    • extractValue

      String extractValue(String text, String... regexes)
      Extracts the first value that is extracted from one of the regular expressions.
      Parameters:
      text - the text to be evaluated
      regexes - the regular expressions (1 or more) that knows how to extract values from the text. Note that regex with .* terms cannot be used and excluded.
      Returns:
      the first value of the first regex that extracts a value from the text
    • extractAllValues

      List<String> extractAllValues(String text, String... regexes)
      Extracts all the values from all the regular expressions.
      Parameters:
      text - the text to be evaluated
      regexes - the regular expressions (1 or more) that knows how to extract values from the text. Note that regex woth .* terms cannot be used and excluded.
      Returns:
      all the values extracted from all the regular expressions.