re module: Nothing to repeat, but no sre_constants.error: nothing to repeat ?

Devin Jeanpierre jeanpierreda at
Tue Feb 14 05:38:03 CET 2012

Hey Pythonistas,

Consider the regular expression "$*". Compilation fails with the
exception, "sre_constants.error: nothing to repeat".

Consider the regular expression "(?=$)*". As far as I know it is
equivalent. It does not fail to compile.

Why the inconsistency? What's going on here?

-- Devin

More information about the Python-list mailing list