W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

ANNOUNCE: Translator from XSD regex syntax to Java regex syntax

From: James Clark <jjc@jclark.com>
Date: Tue, 30 Apr 2002 16:52:53 +0700
To: xmlschema-dev@w3.org
Message-ID: <1325505806.1020185573@[]>
I've written some Java code that translates from the syntax of XSD regexes 
to the syntax of JDK 1.4 java.util.regex regexes.  The source, binaries and 
documentation can be downloaded from:


I am releasing it under a very liberal license (the BSD license), which 
makes it free even for commercial use.

XSD regexes are based on Perl regexes and JDK 1.4 regexes are based on Perl 
regexes, so you might think the translation would be trivial.  However, it 
turns out that doing a 100% job is quite tricky.  In particular, JDK 1.4 
regexes deal with sequences of 16-bit code values, whereas as XSD regexes 
deal with characters.  Also JDK 1.4 supports Unicode 3.0, whereas XSD 
requires at least Unicode 3.1.  So, for example, something as simple as 
\p{L} in XSD would be equivalent to the following JDK regex:


Please report any bugs you find to me directly.

Received on Tuesday, 30 April 2002 05:50:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:01 UTC