Translate XSLT/XPath-patterns into regular expressions?

Thomas Weholt thomas at
Mon Feb 26 12:26:17 CET 2001

I need to translate patterns similar to those used in XSLT/XPath into
regular expressions.
Typical examples are '/sometag/*/mytag' matching every 'mytag' that has
'sometag' as root-node, regardless of tags inbetween them. Another example
could be '/sometag/my*' matching every tag starting with 'my' that has
'sometag' as parent and root-node.

Not being good at regular expressions at all ( just started at the HowTo
actually ), could anyone give a clue on how to go about this or point to
sites/docs with more information about regular expressions ( preferrably
using Python, but all general information is of interest ) ?

The last question; what is the status of available modules for regular
expression in Python and are there problems with them one should be aware

PS! What about the book from Oreilly, 'Mastering Regular Expressions'? It
seemed very pro-Perl, at least from the table of contents. Are the
information given in it easily used in Python too?


More information about the Python-list mailing list