I'm trying to match a certain phrase using regexp, with words boundaries, but it's not working as expected. What am I doing wrong?
if (preg_match("~\b(and you[?])\b~", " and you? ")) { echo "success"; }
Does not echo "success".
However with the word boundary excluded:
if (preg_match("~(and you[?])~", " and you? ")) { echo "success"; }
It echos "success" for some reason.