I'm trying to use the following code to match the text est/(?P[0-9]{4}).
using: https://regexr.com/
it matches the text, however in python it fails to match the same text with the same expression:
[^a-z0-9\/]
Here is the code with both conditions. I'm not sure why the regEx will match in regexr.com but not in python unless there is a number sign.
import os
import re
#no work
if re.match("[^a-z0-9\/]", "test/(?P<year>[0-9]{4})"):
print "match"
else:
print "no match"
#works
if re.match("[^a-z0-9\/]", "#test/(?P<year>[0-9]{4})"):
print "match"
else:
print "no match"