Reputation: 1038
I have a regex that finds if there is a period or a " (quote char) or a word in a line. I have to escape the period and the " chars.
res = re.match(ur"\"|\.|\w+",line)
The regex seems to work in Linux but in Windows I amn getting a syntax error. Any suggestions?
Upvotes: 2
Views: 181
Reputation: 92996
If you have double quotes in your string, then enclose your string in single quotes, so you don't need to escape the double quotes.
res = re.match(ur'"|\.|\w+',line)
Upvotes: 1