This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nneonneo
Recipients BMintern, effbot, gerardjp, mchaput, nneonneo, timehorse
Date 2009-01-14.14:34:00
SpamBayes Score 0.004110973
Marked as misclassified No
Message-id <>
Well, in this example the group (ar) is unmatched, so sre throws the
error, and because of the alternation, the workaround you mentioned
doesn't seem to directly apply.

A better example is probably
because this can't be simply repaired by refactoring the regex.

The correct behaviour, as I have observed in other regex
implementations, is to replace the group by the empty string; for
example, in Javascript:
>>> 'foobar'.replace(/foo(?:b(ar)|baz)/,'$1')
>>> 'foobaz'.replace(/foo(?:b(ar)|baz)/,'$1')
Date User Action Args
2009-01-14 14:34:03nneonneosetrecipients: + nneonneo, effbot, mchaput, timehorse, BMintern, gerardjp
2009-01-14 14:34:03nneonneosetmessageid: <>
2009-01-14 14:34:02nneonneolinkissue1519638 messages
2009-01-14 14:34:00nneonneocreate