Regex101 icon indicating copy to clipboard operation
Regex101 copied to clipboard

Communicate the Python version on the website (Which is not python 3, its actually python 2)

Open mangelozzi opened this issue 1 year ago • 0 comments

Python 2 is deprecated, and there are some gotcha when developing regex's with it compared to Python 3. I don't think many people use Python 2 anymore. I recommend adding a 2 after the python to help people not get bit by the same issues I have encountered, something like this:

image

E.g. this regex from django:

r"""(?P<matched>import(?s:(?P<import>[\s\{].*?))\s*from\s*['"](?P<url>[./].*?)["']\s*;)"""

Is valid in Python3, but this website says it's invalid, leading one to waste so much time trying to figure out the "error"

mangelozzi avatar Aug 09 '24 13:08 mangelozzi