#!/usr/local/bin/python # KMB 2002 Nov 13 # Test: echo "The cat sat on the the dog. Why why why?" | thethe.py # mcopy -o thethe.py a: from sys import stdin from re import findall,compile,IGNORECASE for r in findall(compile(r'\b(\w+)\s+\1\b',IGNORECASE),stdin.read()): print "Repeated word: '"+r+"'"