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.
|
static ARegularExpression |
compile(java.lang.String pattern,
java.lang.String flags)
Static factory method intended for simple static regular expressions known to be correct
|
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.
|
java.lang.CharSequence |
replaceWith(java.lang.CharSequence input,
java.util.function.Function<java.lang.CharSequence,java.lang.CharSequence> replacer)
Replace all substrings of a supplied input string that match the regular expression
with a replacement string.
|
AtomicIterator |
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 static ARegularExpression compile(java.lang.String pattern, java.lang.String flags)
java.lang.IllegalArgumentException - if the pattern or flags are incorrectpublic 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 AtomicIterator 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.CharSequence replaceWith(java.lang.CharSequence input,
java.util.function.Function<java.lang.CharSequence,java.lang.CharSequence> replacer)
throws XPathException
replaceWith in interface RegularExpressioninput - the input string on which replacements are to be performedreplacer - 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-2021 Saxonica Limited. All rights reserved.