"Buy new XXX sex bla-bla-bla" and I need to find if
ZZZ, or any 3 or more repeated characters. Of course I can do some array and go down the wrong way, but maybe is here some
trick? Thank you.
PS. Google doesn't help.
import re if re.search(r'(.)\1\1', mystr): print "Has triple letters"
something like this:
In : for x,y,z in zip(strs,strs[1:],strs[2:]): ....: if x==y==z and x: ....: print x+y+z ....: XXX