if (preg_match(\'#\\b\'.$rawword.\'\\b#i\',$body)) {
This code finds whole words, but if they are a hyphen word like \"ABLE-BODIED\" it will find AB
You can use lookbehind and lookahead operators. This operators looks in behind and after but not match them.
for example use \b(? for finding whole words of xyz that doesn't have - before or after.
\b(? for finding whole words of xyz that doesn't have - before or after.
xyz
-