andreasvc / pyre2

Python wrapper for RE2
BSD 3-Clause "New" or "Revised" License
99 stars 33 forks source link

Ignore non-matched groups when replacing with sub #1

Closed pvaneynd closed 7 years ago

pvaneynd commented 7 years ago

From 3.5 onwards sub() and subn() now replace unmatched groups with empty strings. See:

https://docs.python.org/3/whatsnew/3.5.html#re

This change removes the 'unmatched group' error which occurs when using re2.

andreasvc commented 7 years ago

Thx!