Mark Shannon added the comment:

This looks like the expected behaviour to me.
re.sub matches the leftmost occurence and the regular expression is greedy so 
(x|xy) will always match xy if it can.

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23532>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to