Anomalous behaviour when compiling regular expressions?

Fredrik Lundh fredrik at
Mon Mar 13 22:42:30 CET 2006

Harvey.Thomas at wrote:

> I agree to a certain extent, but by analogy
> <!DOCTYPE a [
> <!ELEMENT a (b | c*)+>
> ]>
> <a></a>
> is a valid SGML/XML document and their is a lot of (superficial?)
> similarity between DTD content models and REs.

they're related, but they don't have the same semantics (Python uses
a backtracking engine, while the DTD model is a true DFA).


More information about the Python-list mailing list