Could someone please explain this code to me ? Thanks !
eregi("0-9a-z@0-9a-z\.[a-z]{2,3}$", $email)
What I'm confused of are those code in brackets -> ([-_.]?[0-9a-z]) and ([-.]?[0-9a-z])*\. I'm not sure of how this work. I'm ok with the rest.
its making a check on following:
name@domain.com
the first part is allowing everything from 0 to 9 and -, _ and . to a down to z.
then same goes for after @. and then at the end, only a to z is allowed in .com etc.
its an email format checking.
Well, the code in brackets actually forbid anything that comes with these -_ . ( )? characters, no matter where you put them ( either in front or at the back )
I just wonder how to interprete these particular code for this purpose.
Ok. So far so good.
But how do I do to extract all email adresses from a pice of text?