# XSD to Java Regular Expression Translator

Copyright © 2002 Thai Open Source Software Center Ltd

See the file copying.txt for copying permission.

### Version @VERSION@

The main component of this distribution is code for translating from the regular expression syntax of XML Schema Part 2 into the syntax of regular expressions used by the JDK 1.4 `java.util.regex` package. Although these two syntaxes are superficially similar, there are numerous differences, many of them rather subtle.

- `xsdregex.jar` contains the compiled code
- the `src` directory contains the source code
- there is also API documentation

There is also some supporting code:

- a simple API for matching regular expressions
- implementations of this interface using
  - the Xerces 1 regular expression implementation
  - the Xerces 2 regular expression implementation
  - translation into JDK 1.4 `java.util.regex` regular expressions
- testing framework using this interface (in the package `com.thaiopensource.datatype.xsd.regex.test` and in the `test` directory)
- code for dynamically loading the appropriate implementation using the service provider approach

To compile from source, you will need:

- JDK 1.4 (i.e. J2SE 1.4 SDK)
- UnicodeData-3.1.0.txt one of the files in the Unicode character database
- if you want support for Xerces 1-based regular expression implementation, Xerces Java 1
- if you want support for Xerces 2-based regular expression implementation, Xerces Java 2
- Ant

Compile by applying Ant to the included `build.xml` file.