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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -