Package com.thepluginpeople.jemhod.api
Interface IRegexUtils
public interface IRegexUtils
Utility bean used to run regular expression in velocity.
- Author:
- Fernando Boucquez
-
Method Summary
Modifier and TypeMethodDescriptionextractAllValues
(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
Evaluates if text matches at least one of the regular expressions (one or multiple can be provided)- Parameters:
text
- the text to be evaluatedregexes
- 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
Extracts the first value that is extracted from one of the regular expressions.- Parameters:
text
- the text to be evaluatedregexes
- 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
Extracts all the values from all the regular expressions.- Parameters:
text
- the text to be evaluatedregexes
- 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.
-