I would like to match a string for word1 or word, but a string like "this is a test word" should NOT match. I'm trying to do preg_match('/^\b(word|word1)\b/i',$string)but no luck
preg_match('/^\b(word|word1)\b/i',$string)
This seems like normal if you remove ^from the beginning of your RegEx ..
^
I think your problem in the beginning ^:
preg_match('/\b(word|word1)\b/i',$string);
Note that this ^marks the beginning of a line, so you are looking for something that starts with the parameters you give.