public class ARegularExpression extends Object implements RegularExpression
Constructor and Description |
---|
ARegularExpression(CharSequence pattern,
String flags,
String hostLanguage,
List<String> warnings)
Create and compile a regular expression
|
Modifier and Type | Method and Description |
---|---|
RegexIterator |
analyze(CharSequence input)
Use this regular expression to analyze an input string, in support of the XSLT
analyze-string instruction.
|
boolean |
containsMatch(CharSequence input)
Determine whether the regular expression contains a match of a given string
|
boolean |
matches(CharSequence input)
Determine whether the regular expression matches a given string in its entirety
|
CharSequence |
replace(CharSequence input,
CharSequence replacement)
Replace all substrings of a supplied input string that match the regular expression
with a replacement string.
|
SequenceIterator<StringValue> |
tokenize(CharSequence input)
Use this regular expression to tokenize an input string.
|
public ARegularExpression(CharSequence pattern, String flags, String hostLanguage, List<String> warnings) 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 regexXPathException
- if the regular expression is invalidpublic boolean matches(CharSequence input)
matches
in interface RegularExpression
input
- the string to matchpublic boolean containsMatch(CharSequence input)
containsMatch
in interface RegularExpression
input
- the string to matchpublic SequenceIterator<StringValue> tokenize(CharSequence input)
tokenize
in interface RegularExpression
input
- the string to be tokenizedpublic RegexIterator analyze(CharSequence input)
analyze
in interface RegularExpression
input
- the character string to be analyzed using the regular expressionpublic CharSequence replace(CharSequence input, CharSequence replacement) throws XPathException
replace
in interface RegularExpression
input
- 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 invalidCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.