Ok Im trying to figure out this regex where I have a word, and on either end of the word it can be a space or no character. Heres an example:
preg_match_all("/( ?)(" . $piece . ")( ?)/is", $fk, $sub);
Where ( ?)
is I want that to be "A single character that can only be a space or no character at all". Im trying to basically make a function that checks whether something is a word or not based on its surrounding characters. And $piece
is the word, so It has to be by itself, not part of another longer word if you know what I mean. Thanks