start with specific word end with space in regex code example Example: php preg match space or start of string /\b(stackoverflow)\b/