php - finding email with preg_match_all -
i have code find email addresses in given text:
preg_match_all("|[a-za-z0-9-_.]+@[a-za-z0-9-]+.[a-za-z]+|", "</b>a@bexample </b> a@bexample.co ",$out, preg_pattern_order);
and output this:
array ( [0] => array ( [0] => a@bexample//error 1 [1] => a@bexample.co ) )
the first answer isn't true. why?
i forgot "\" before "." should this
"|[a-za-z0-9-_.]+@[a-za-z0-9-]+\.[a-za-z]+|"
Comments
Post a Comment