Per Python's regular expressions documentation here, if we want Python re's to have the same escaping rules as other langs we need to prepend the strings with 'r' for raw. Otherwise, python will escape characters for us during interpretation.
When I generate a parser with the following lex section:
Per Python's regular expressions documentation here, if we want Python re's to have the same escaping rules as other langs we need to prepend the strings with 'r' for raw. Otherwise, python will escape characters for us during interpretation.
When I generate a parser with the following lex section:
I get the following generated python:
These will fail for 'invalid search sequence' or similar, whereas properly prepending the regexes with 'r' manually solves the problem:
The python generator (likely) needs a simple update to prepend 'r' to regex strings.