When using the PCRE regular expression functions, you must enclose a delimited pattern:
PHP separators
Commonly used delimiters are slashes (/), hash signs (#), and tildes (~). Below are all examples of valid separation patterns.
/foo bar/
Then you have to fix this line so that:
$pattern = '/\b[A-Z0-9._%+-] +@ [A-Z0-9.-]+\.[AZ]{2,4}\b/';
or
$pattern = '
user1646111
source share