firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.26k stars 199 forks source link

Python substring causes special charactes to appear despite proper group match #1987

Closed TomKulakov closed 1 year ago

TomKulakov commented 1 year ago

Link to example here: https://regex101.com/r/4QhFpP/1

Description Env: Python Regexp: /(^N\d* )(Z-?\d*(\.\d*)?$)\s(^N\d* )((X-?\d*(\.\d*)? Y-?\d*(\.\d*)?))\s(^N\d* )(Z-?\d*(\.\d*)?$)/mg Replacement: \1(-) \2\n\4(-) \5\n\9(-) \10 Test String:

N1 Z20.875
N2 X52.685 Y27.106
N3 Z16.875

Result:

N1 (-) Z20.875
N2 (-) X52.685 Y27.106
N3 (-) 

I can't copy it, but the square is U+0008 (which is backspace) and if you use deeper groups it became tab or something else

Excpected:

N1 (-) Z20.875
N2 (-) X52.685 Y27.106
N3 (-) Z16.875

This works in other similar tools and in my Python code.

firasdib commented 1 year ago

Thank you. I have fixed this locally and will push soon.

TomKulakov commented 1 year ago

Just adding more facts hoping this will be covered by a fixture - I've noticed that every group equal to 10 or higher causes this error. \10 or \11 ...etc

firasdib commented 1 year ago

I'm releasing this now, should be fixed in a few minutes.

TomKulakov commented 1 year ago

Tested on two cases. Works like it should! Thank you! PS: I find your platform best tool there is. Ultra elastic configuration, great explanation of rules, cozy design. :) Thank you for this!

firasdib commented 1 year ago

Thank you!Vänliga hälsningar / Best regards,Firas DibOn 14 Feb 2023, at 06:59, TomKulakov @.***> wrote: Tested on two cases. Works like it should! Thank you! PS: I find your platform best tool there is. Ultra elastic configuration, great explanation of rules, cozy design. :) Thank you for this!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: @.***>