https://bugzilla.wikimedia.org/show_bug.cgi?id=54562
--- Comment #4 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- I don't understand this bug. What is the traceback before this patch is implemented. And what should that replaceexcept() do in your special case Could you give me a full example. You may exclude this group by "bla(?:AAA)?bla"; would this help?