Yet another RE question
bogdanal at b.astral.ro
Sat Jan 10 09:36:07 CET 2004
First I want to apologize if this was already discussed before, I can't find an answer anywhere right now. I'm writing a simple compiler for a small language using Spark (http://pages.cpsc.ucalgary.ca/~aycock/spark/). And I just found out that the regular expressions in Python follow the Perl semantics (first-then-longest) instead of the POSIX semantics (longest match). This is quite annoying for me; while some solutions to this problem exists and they are shown in the Spark documentation, I have some background with lex/yacc and I would really like to use the "lex" semantics (longest match). Is there a package for Python that implements this behaviour?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list