Implementing a string match routine.