net.sf.saxon.regex
public class JDK15RegexTranslator extends RegexTranslator
Nested Class Summary | |
---|---|
static class | JDK15RegexTranslator.BackReference |
abstract static class | JDK15RegexTranslator.CharClass |
static class | JDK15RegexTranslator.CharRange |
static class | JDK15RegexTranslator.Complement |
static class | JDK15RegexTranslator.Empty |
static class | JDK15RegexTranslator.Property |
abstract static class | JDK15RegexTranslator.SimpleCharClass |
static class | JDK15RegexTranslator.SingleChar |
static class | JDK15RegexTranslator.Subtraction |
static class | JDK15RegexTranslator.Union |
Field Summary | |
---|---|
static JDK15RegexTranslator.CharClass[] | categoryCharClasses
Translates XML Schema and XPath regexes into java.util.regex regexes.
|
static JDK15RegexTranslator.CharClass[] | specialBlockCharClasses
CharClass for each block name in specialBlockNames. |
static JDK15RegexTranslator.CharClass[] | subCategoryCharClasses |
Method Summary | |
---|---|
static void | main(String[] args)
Main method for testing. |
static String | translate(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() |
java.util.regex
regexes.
See Also: java.util.regex.Pattern XML Schema Part 2
Parameters: args command line arguments arg[0] a regular expression arg[1] = xpath to invoke the XPath rules
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.Parameters: xmlVersion set to XML10 for XML 1.0 or XML11 for XML 1.1 regExp a String containing a regular expression in the syntax of XML Schemas Part 2 xpath a boolean indicating whether the XPath 2.0 F+O extensions to the schema regex syntax are permitted ignoreWhitespace true if whitespace is to be ignored ('x' flag) caseBlind true if case is to be ignored ('i' flag)
Returns: a JDK 1.5 regular expression
Throws: RegexSyntaxException if regexp
is not a regular expression in the
syntax of XML Schemas Part 2, or XPath 2.0, as appropriate
See Also: java.util.regex.Pattern XML Schema Part 2