For the python golfers..... a='foobar' b='foobaz' m='' for (x,y) in zip(a,b): m+= x * (x==y) m contains the matching substring. That's as close to one line as I could get. :) Cheers, jay