The class uses the following regular expression:
var $email_regular_expression="^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,6}\$";
Though when I try the following:
$string='marcel has emailaddress [email]john@doe.com[/email]';
$emailregexp="^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}]+\\.)+[a-zA-Z]{2,6}\$";
preg_match("$emailregexp",$string,$matches);
echo $matches[0];
I get the error "Warning: Unknown modifier '_' in /var/www/blaat2.php on line 36"
What do I do wrong? I want only "john@doe.com" as output. The input is now an example text, but in the future the input text is something like:
person: Wiljan Dankers
address: Brandevoortse Dreef 2
address: Helmond
address: The Netherlands
phone: +31 3003530035
e-mail: abuse@chello.nl
nic-hdl: WD294-RIPE
remarks: complaints about spam and other net-abuse: abuse@chello.nl
mnt-by: EU-IBM-NIC-MNT2
changed: Rodney@dyn0mic.nl 20010426
source: RIPE
And the output should be something like:
abuse@chello.nl
abuse@chello.nl
Rodney@dyn0mic.nl
Is that possible while using the reg.exp. above? I read the other articles but it doesn't make complete sense to me yet, hope that will come soon 🙂
Thanks. Marcel