Below match doesn't work:
import re
pattern = re.compile("[\^\/!*\[({%?$]")
param = "f00.*"
if pattern.match(param):
print " I am a regexp"
else:
print "non regexp"
But this does:
import re
node_pattern = re.search("[\^\/!*\[({%?$]", "f00.*")
print bool(node_pattern)
What's wrong with re.compile()?
Isn't it the valid way to match a string against a regexp?