net.sf.saxon.regex
public class JDK14RegexTranslator extends Object
Nested Class Summary | |
---|---|
static class | JDK14RegexTranslator.BackReference |
abstract static class | JDK14RegexTranslator.CharClass |
static class | JDK14RegexTranslator.CharRange |
static class | JDK14RegexTranslator.Complement |
static class | JDK14RegexTranslator.Dot |
static class | JDK14RegexTranslator.Empty |
static class | JDK14RegexTranslator.Property |
static class | JDK14RegexTranslator.Range |
abstract static class | JDK14RegexTranslator.SimpleCharClass |
static class | JDK14RegexTranslator.SingleChar |
static class | JDK14RegexTranslator.Subtraction |
static class | JDK14RegexTranslator.Union |
static class | JDK14RegexTranslator.WideSingleChar |
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 |
Constructor Summary | |
---|---|
JDK14RegexTranslator() |
Method Summary | |
---|---|
int | getNumberOfCapturedGroups() |
static void | main(String[] args) |
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
Returns: a String containing a regular expression in the syntax of java.util.regex.Pattern
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