Contact: aviboots(AT)netvision.net.il
39,907 questions
51,839 answers
573 users
import re s = 'xyxxxyyyxyxxyy' pattern = 'xy{2}' # 'x' followed by two 'y' for match in re.findall(pattern, s): print('Found: {!r}'.format(match)) ''' run: Found: 'xyy' Found: 'xyy' '''