[xsd-users] Using regular expressions

Christopher Fuhrman christopher.fuhrman at etsmtl.ca
Thu Oct 8 15:19:17 EDT 2009


Hi all,

On Thu, Oct 8, 2009 at 12:48 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> BTW, you can use the --anonymous-regex-trace option to see what your
> expressions are applied to and whether they match. Useful for
> debugging.
>
> The above approach will require a separate expression for each schema
> file and can become a bit tedious. If you don't mind using a more
> "regular" naming scheme then you can cover all your schema files with
> one expression. For example, this regex:
>
> --anonymous-regex ',.* .* (.*)/(.*),$1_$2,'
>
> Will name all your anonymous types like StateWHType_AmendedReturnElect,
> StateUIType_AmendedReturnElect, etc.
>

For regex testing, I recommend any of the many regex debugging tools that
are available these days (some are even available in web pages or plug-ins
to your favorite IDE). They save a lot of time since you can experiment with
a reg-ex in one field, a sample text in another, and you see what would be
matched/replaced, etc. before actually running it in the tool that requires
the reg-ex.

--
Cris



More information about the xsd-users mailing list