Class RegEx
- Direct Known Subclasses:
RegExList
,RegExSimple
The regular-expression to use for matching groups.
It should always define at least one group (i.e. using parentheses).
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns a boolean whether the regular-expression successfully matches a string or not.Returns an array of string components it matches successfully, orOptional.empty()
if it cannot match.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
RegEx
public RegEx()
-
-
Method Details
-
match
Returns an array of string components it matches successfully, orOptional.empty()
if it cannot match.- Parameters:
string
- string to match against the regular-expression.- Returns:
- an array of string components representing each group in the match, or
Optional.empty()
if no match is possible.
-
hasMatch
Returns a boolean whether the regular-expression successfully matches a string or not.- Parameters:
string
- string to match against the regular-expression.- Returns:
- true if successfully matched, false otherwise.
-