A regexp that uses an inverted range (square brackets starting with a
caret) will give misleading results. For example [^9-0] may match all digits.
The problem is that the parser for a regexp does not order the character
intervals before sending them to alphabet.invert. This can be fixed by
changing the definition of "invert" in make_str_parser (lepl.regexp.str) to
invert = lambda x: alphabet.invert(Character(x, alphabet))
since Character() does sort the intervals.
The next release of LEPL (2.4) will include this fix.
Andrew
Original issue reported on code.google.com by acooke....@gmail.com on 19 Apr 2009 at 2:32
Original issue reported on code.google.com by
acooke....@gmail.com
on 19 Apr 2009 at 2:32