fork download
  1. import re
  2. print( [x.group() for x in re.finditer(r'([a-zA-Z])(?!\1)(?i:\1)', 'aADFfGcCgs')] )
  3. print( [x for x,y in re.findall(r'(([a-zA-Z])(?!\2)(?i:\2))', 'aADFfGcCgs')] )
Success #stdin #stdout 0.02s 9664KB
stdin
Standard input is empty
stdout
['aA', 'Ff', 'cC']
['aA', 'Ff', 'cC']