I am trying to write a regular expression that will match a - (dash), followed by as many letters as it possibly can. What I have at the moment, is the following: exp = (-[a-z A-z]*).
I am getting a SyntaxError: invalid syntax error though.
to expand on @vaultah's comment you need to make the expression a string: exp = "(-[a-z A-z]*)" otherwise you try to define a python expression which doesn't like that syntax.
exp = "(-[a-z A-z]*)"otherwise you try to define a python expression which doesn't like that syntax.