Thank you for replying. I am very new to this, so sorry for the confusion.
I am adding words to a line, but do not want to duplicate. The 2 strings are $words and $w. However, if advertise is one word, I don't want the word "ad" to be left out. My expression is only checking if the 2 words are equal to each other, I need to be checking past the first 2 characters.