public class JDK15RegexTranslator extends RegexTranslator
RegexTranslator.Range| Modifier and Type | Field | Description |
|---|---|---|
static net.sf.saxon.java.JDK15RegexTranslator.CharClass[] |
categoryCharClasses |
Translates XML Schema and XPath regexes into
java.util.regex regexes. |
static net.sf.saxon.java.JDK15RegexTranslator.CharClass[] |
specialBlockCharClasses |
CharClass for each block name in specialBlockNames.
|
static net.sf.saxon.java.JDK15RegexTranslator.CharClass[] |
subCategoryCharClasses |
ALL, captures, caseBlind, curChar, currentCapture, eos, ignoreWhitespace, inCharClassExpr, isXPath, length, NONE, NOT_ALLOWED_CLASS, pos, regExp, result, SOME, SURROGATES1_CLASS, SURROGATES2_CLASS, xmlVersion| Modifier and Type | Method | Description |
|---|---|---|
static void |
main(java.lang.String[] args) |
Main method for testing.
|
static java.lang.String |
translate(java.lang.CharSequence regExp,
int xmlVersion,
boolean xpath,
boolean ignoreWhitespace,
boolean caseBlind) |
Translates a regular expression in the syntax of XML Schemas Part 2 into a regular
expression in the syntax of
java.util.regex.Pattern. |
protected boolean |
translateAtom() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitabsorbSurrogatePair, advance, copyCurChar, expect, highSurrogateRanges, isAsciiAlnum, isBlock, isJavaMetaChar, lowSurrogateRanges, makeException, makeException, parseQuantExact, recede, sortRangeList, translateBranch, translateQuantifier, translateQuantity, translateRegExp, translateToppublic static final net.sf.saxon.java.JDK15RegexTranslator.CharClass[] categoryCharClasses
java.util.regex regexes.Pattern,
XML Schema Part 2public static final net.sf.saxon.java.JDK15RegexTranslator.CharClass[] subCategoryCharClasses
public static final net.sf.saxon.java.JDK15RegexTranslator.CharClass[] specialBlockCharClasses
public static java.lang.String translate(java.lang.CharSequence regExp,
int xmlVersion,
boolean xpath,
boolean ignoreWhitespace,
boolean caseBlind)
throws RegexSyntaxException
java.util.regex.Pattern. The translation
assumes that the string to be matched against the regex uses surrogate pairs correctly.
If the string comes from XML content, a conforming XML parser will automatically
check this; if the string comes from elsewhere, it may be necessary to check
surrogate usage before matching.xmlVersion - set to Configuration.XML10 for XML 1.0
or Configuration.XML11 for XML 1.1regExp - a String containing a regular expression in the syntax of XML Schemas Part 2xpath - a boolean indicating whether the XPath 2.0 F+O extensions to the schema
regex syntax are permittedignoreWhitespace - true if whitespace is to be ignored ('x' flag)caseBlind - true if case is to be ignored ('i' flag)RegexSyntaxException - if regexp is not a regular expression in the
syntax of XML Schemas Part 2, or XPath 2.0, as appropriatePattern,
XML Schema Part 2protected boolean translateAtom()
throws RegexSyntaxException
translateAtom in class RegexTranslatorRegexSyntaxExceptionpublic static void main(java.lang.String[] args)
throws RegexSyntaxException
args - command line arguments
arg[0] a regular expression
arg[1] = xpath to invoke the XPath rulesRegexSyntaxException