Class Translator
- java.lang.Object
-
- com.thaiopensource.datatype.xsd.regex.java.Translator
-
public class Translator extends Object
Translates XML Schema regexes intojava.util.regexregexes.- See Also:
Pattern, XML Schema Part 2
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(String[] args)static Stringtranslate(String regexp)Translates a regular expression in the syntax of XML Schemas Part 2 into a regular expression in the syntax ofjava.util.regex.Pattern.
-
-
-
Method Detail
-
translate
public static String translate(String regexp) throws RegexSyntaxException
Translates a regular expression in the syntax of XML Schemas Part 2 into a regular expression in the syntax ofjava.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- Returns:
- a String containing a regular expression in the syntax of java.util.regex.Pattern
- Throws:
RegexSyntaxException- ifregexpis not a regular expression in the syntax of XML Schemas Part 2- See Also:
Pattern, XML Schema Part 2
-
main
public static void main(String[] args) throws RegexSyntaxException
- Throws:
RegexSyntaxException
-
-