Normally you would put an r in front of the string to make it raw, but how to do this with a variable (string)?
This is what I tried so far:
import re
var = "++"
re.search(r"++", "++") # also does not work
re.search(var, "++") # fails
re.search(r(var), "++") # fails
re.search(r + var, "++") # fails
re.search("r" + var, "++") # fails
re.search(r"++", "++")does not work for me (python 2.7.5), as expected --- becuase "++" is not a valid regex.+is a special symbol, and you need to escape it if you want to match it.