net.sf.saxon.regex
public class JDK15RegexTranslator extends Object
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 |
static class | JDK15RegexTranslator.Range |
abstract static class | JDK15RegexTranslator.SimpleCharClass |
static class | JDK15RegexTranslator.SingleChar |
static class | JDK15RegexTranslator.Subtraction |
static class | JDK15RegexTranslator.Union |
Field Summary | |
---|---|
static int | ALL |
static String | CATEGORY_NAMES |
static int[][] | CATEGORY_RANGES |
static String | NMCHAR_CATEGORIES |
static String | NMCHAR_EXCLUDE_RANGES |
static String | NMCHAR_INCLUDES |
static String | NMSTRT_CATEGORIES |
static String | NMSTRT_EXCLUDE_RANGES |
static String | NMSTRT_INCLUDES |
static int | NONE |
static String | NOT_ALLOWED_CLASS |
static int | SOME |
static String | SURROGATES1_CLASS |
static String | SURROGATES2_CLASS |
Method Summary | |
---|---|
static void | main(String[] args) |
static String | translate(CharSequence regexp, boolean xpath)
Translates a regular expression in the syntax of XML Schemas Part 2 into a regular
expression in the syntax of java.util.regex.Pattern . |
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: 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
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