I need a regexp. that compares two strings and checks if they have at least one word in common.
string1 = "The man has a dog"
string2 = "I don't like cats but I have a dog"
Both strings contains the words "a" and "dog" and the expression should now return true.
I imagine that it is possible to write one expression that handles this instead of doing pattern matching on every word from one string in the other string.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…