I have following:
temp = "aaaab123xyz@+"
lists = ["abc", "123.35", "xyz", "AND+"]
for list in lists
if re.match(list, temp, re.I):
print "The %s is within %s." % (list,temp)
You can use
re.search instead of
It also seems like you don't really need regular expressions here. Your regular expression
123.35 probably doesn't do what you expect because the dot matches anything.
If this is the case then you can do simple string containment using
x in s.