zenlc2000 / pyp3

Pyed Piper tool by Toby Rosen at Sony Imageworks converted to Python 3
34 stars 13 forks source link

p.replace(p.re()) regression #11

Closed bobpaul closed 7 years ago

bobpaul commented 7 years ago

My fix for #3 broke the case of p.replace(p.re()). While that case isn't always predictable, it was usable within limits.

The manual notes

all lines that test False ('', {}, [], False, 0) are eliminated from the output completely. You can instead print out a blank line if something tests false using --keep_false.

the re() function should return to returning an empty line on no match. The correct fix for #3 is filtering out '' lines at the output stage.