So (correct me if I'm wrong) the take-home from this is that ure has a limitation by design.
In CPython and MicroPython the string r'\n' contains two characters, '\' and 'n'. CPython's re module interprets these as a '\n' character while ure treats them literally.
I guess in most cases the workround is to avoid (or at least think hard about) r strings in ure regexes.
re.sub regex won't match
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: re.sub regex won't match
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.