public class Translator extends Object
java.util.regex
regexes.Pattern
,
XML Schema Part 2Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
static String |
translate(String regexp)
Translates a regular expression in the syntax of XML Schemas Part 2 into a regular
expression in the syntax of
java.util.regex.Pattern . |
public static String translate(String regexp) 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.regexp
- a String containing a regular expression in the syntax of XML Schemas Part 2RegexSyntaxException
- if regexp
is not a regular expression in the
syntax of XML Schemas Part 2Pattern
,
XML Schema Part 2public static void main(String[] args) throws RegexSyntaxException
RegexSyntaxException