adding spacenat end of string in regular expression code example Example: php preg match space or start of string /\b(stackoverflow)\b/