Mike Mapsnac wrote:
Hello
I found this function online and want to understand how it works.
I don't understand /^ and $/. I know that ^ beginning of the
string but what is /^.
Thanks
function validEmail($email)
{
return
I think he meant.. the carrot after the delimiter
which means NOT.. like /[^a]/ means match anything thats not an 'a'
Jason
Justin Patrin [EMAIL PROTECTED] wrote:
Mike Mapsnac wrote:
Hello
I found this function online and want to understand how it works.
I don't understand /^ and
preg_match(/^([a-zA-Z0-9])+([.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-]+)+[a-zA-Z0-9_-]$/,$email);
The / characters are the regex delimiters. This is a throwback to the
Perl language. Basically, the / show where the beginning and end of the
regex is. You *MUST* have them. After the last
3 matches
Mail list logo