I have a regular expression like preg_match_all (PHP) that filters emails in text.
Example:
txt = " tenho ujm texto onde tem um e-mail georgios@teste.com e seu amigos <a> georgios@lask.com </a>
mirian@bagato.com sem contar";
return: georgios@teste.com, georgios@lask.com, mirian@bagato.com
I need to filter from a text, all @firstname.name or @name.
Example:
txt = "Testando se essa pescaria é valida @ju1lio.leao, se não for aciona @alycianne.
Importante deixar @mirian ciente. E a @simone.akemi de sobreaviso.";
return: @mirian,@ju1lio.leao,@alycianne,@simone.akemi
I'm currently using the patterns:
pattern = '/\@([a-z0-9\-])+/i';
pattern1 = '/\@(([a-z0-9\-])+\.)+([a-z0-9])+/i';
Return: Array
(
[0] => @alycianne
[1] => @ju1lio
[2] => @ju1lio.leao
[3] => @mirian
[4] => @simone
[5] => @simone.akemi
)
The expressions are filtering names from text incorrectly. Some help/idea ?