DarkAssassin_vbulletin3_import36635
New Member
Hi Im attempting to search a string to see whether it contains a email address - and then return it.A typical email vaildator expression is:\[code\]eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);\[/code\]However how would I search if that is in a string, for example return the email address in the string:"Hi my name is Joe, I can be contacted at [email protected]. I am also on Twitter."I am a bit stumped, I know I can search if it exists at all with \b around it but how do I return what is found.Thanks.