pfalcon / pycopy

Pycopy - a minimalist and memory-efficient Python dialect. Good for desktop, cloud, constrained systems, microcontrollers, and just everything.
http://pycopy.readthedocs.io
MIT License
806 stars 78 forks source link

ure: mixing named classes and characters in a match set raises ValueError #29

Closed c0d3z3r0 closed 5 years ago

c0d3z3r0 commented 5 years ago

Tested on unix and esp8266, master branch

>>> ure.compile('\d+')
<re 3fff02f0>

>>> ure.compile('[abc0-9]+')
<re 3fff0580>

>>> ure.compile('[abc\d]+')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Error in regex

>>> ure.compile('[\w\d]+')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Error in regex
pfalcon commented 5 years ago

Yes, this was never supported (never parsed properly), With recent changes (WIP so far), any (well, most) unsupported regex syntax now raises an error instead of silent unexpected behavior.

pfalcon commented 5 years ago

Ok, these changes are finished now. Nothing really new from when this issue was posted, they were just promoted from "WIP" to "finalized". The docs were updated yet then too: https://pycopy.readthedocs.io/en/latest/library/ure.html