On 10 Mai, 07:52, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In the past weeks i've been thinking over the problem on the practical > problems of regex in its matching power. For example, often it can't > be used to match anything of nested nature, even the most simple > nesting. It can't be used to match any simple grammar expressed by > BNF. Some rather very regular and simple languages such as XML, or > even url, email address, are not specified as a regex.
Well formed XML cannot be fully specified within BNF as well because it is context sensitive: in order to recognize a tag/endtag pair one has to maintain a stack. That's not a big deal in practice if one wants to write an XML parser but one can't use an arbitrary LL or LR parser generator to produce a parse tree representing the XML. -- http://mail.python.org/mailman/listinfo/python-list