PHP's regex functions (preg_match, preg_match_all, preg_replace, preg_split) use the PCRE engine and require patterns delimited by a character such as /pattern/flags. preg_match() returns 1 if a match is found and can populate a matches array via reference.
preg_replace_callback() is preferred over preg_replace() with the /e modifier (removed in PHP 7) when replacement logic needs to run code rather than a static string.