public class RegExSimple extends RegEx
The regular-expression should contain groups, each of which provides an element of the String[]
returned for a match.
Constructor and Description |
---|
RegExSimple() |
RegExSimple(String matchString)
Creates with an expression that should match one or more groups.
|
RegExSimple(String expression,
Pattern pattern) |
Modifier and Type | Method and Description |
---|---|
String |
getExpression()
A Java-style regular expression containing groups.
|
Optional<String[]> |
match(String string)
Returns an array of string components it matches successfully, or
Optional.empty() if
it cannot match. |
void |
setExpression(String expression)
A Java-style regular expression containing groups.
|
String |
toString()
By default, we use
AnchorBean.describeBean() as the string representation of the bean. |
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise
public RegExSimple(String matchString)
matchString
- a Java-style regular-expression.public RegExSimple()
public Optional<String[]> match(String string)
RegEx
Optional.empty()
if
it cannot match.match
in class RegEx
string
- string to match against the regular-expression.Optional.empty()
if no match is possible.public String toString()
AnchorBean
AnchorBean.describeBean()
as the string representation of the bean.toString
in class AnchorBean<RegEx>
public String getExpression()
public void setExpression(String expression)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.