What's the difference between an r string (r'foobar') and a normal string ('foobar') in Python? Is r'string' a regex string?
I've tried the following and there aren't any effects on my regex matches:
>>> import re >>> n = 3 >>> rgx = '(?=('+'\S'*n+'))' >>> x = 'foobar' >>> re.findall(rgx,x) ['foo', 'oob', 'oba', 'bar'] >>> >>> rgx2 = r'(?=('+'\S'*n+'))' >>> re.findall(rgx2,x) ['foo', 'oob', 'oba', 'bar'] >>> >>> rgx3 = r'(?=(\S\S\S))' >>> re.findall(rgx3,x) ['foo', 'oob', 'oba', 'bar']