public class ARegularExpression extends java.lang.Object implements RegularExpression
| Constructor and Description |
|---|
ARegularExpression(java.lang.CharSequence pattern,
java.lang.String flags,
java.lang.String hostLanguage,
java.util.List<java.lang.String> warnings,
Configuration config)
Create and compile a regular expression
|
| Modifier and Type | Method and Description |
|---|---|
RegexIterator |
analyze(java.lang.CharSequence input)
Use this regular expression to analyze an input string, in support of the XSLT
analyze-string instruction.
|
boolean |
containsMatch(java.lang.CharSequence input)
Determine whether the regular expression contains a match of a given string
|
java.lang.String |
getFlags()
Get the flags used at the time the regular expression was compiled.
|
boolean |
matches(java.lang.CharSequence input)
Determine whether the regular expression matches a given string in its entirety
|
java.lang.CharSequence |
replace(java.lang.CharSequence input,
java.lang.CharSequence replacement)
Replace all substrings of a supplied input string that match the regular expression
with a replacement string.
|
SequenceIterator<StringValue> |
tokenize(java.lang.CharSequence input)
Use this regular expression to tokenize an input string.
|
public ARegularExpression(java.lang.CharSequence pattern,
java.lang.String flags,
java.lang.String hostLanguage,
java.util.List<java.lang.String> warnings,
Configuration config)
throws XPathException
pattern - the regular expressionflags - the flags (ixsmq)hostLanguage - one of "XP20", "XP30", "XSD10", "XSD11". Also allow combinations, e.g. "XP20/XSD11".warnings - a list to be populated with any warnings arising during compilation of the regexconfig - the Saxon Configuration: may be nullXPathException - if the regular expression is invalidpublic boolean matches(java.lang.CharSequence input)
matches in interface RegularExpressioninput - the string to matchpublic boolean containsMatch(java.lang.CharSequence input)
containsMatch in interface RegularExpressioninput - the string to matchpublic SequenceIterator<StringValue> tokenize(java.lang.CharSequence input)
tokenize in interface RegularExpressioninput - the string to be tokenizedpublic RegexIterator analyze(java.lang.CharSequence input)
analyze in interface RegularExpressioninput - the character string to be analyzed using the regular expressionpublic java.lang.CharSequence replace(java.lang.CharSequence input,
java.lang.CharSequence replacement)
throws XPathException
replace in interface RegularExpressioninput - the input string on which replacements are to be performedreplacement - the replacement string in the format of the XPath replace() functionXPathException - if the replacement string is invalidpublic java.lang.String getFlags()
getFlags in interface RegularExpressionCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.