examples/regex/same_character.py
from __future__ import print_function

import re

strings = [
   'banana',
   'apple',
]

for s in strings:
    match = re.search(r'(.)\1', s)
    if match:
        print(match.group(0), 'matched in', s)