Hello How to know what has been substituted away, if one does something like: >>> import re >>> rex = re.compile(r"(hans|fred|simon)") >>> st = "max hans bill" >>> st2 = rex.sub("",st) >>> st2 'max bill' It took "hans" away, but how can I learn this automatically? Thanks, Per.