FAO:David Powers


can explain how email pattern works, please?

$pattern = '/^[^@]+@[^\s\r\n\'";,@%]+$/';


--
murray --- icq 71997575
adobe community expert
(if *must* email me, don't laugh when so!)
==================
http://www.dreamweavermx-templates.com - template triage!
http://www.projectseven.com/go - dw faqs, tutorials & resources
http://www.dwfaq.com - dw faqs, tutorials & resources
http://www.macromedia.com/support/search/ - macromedia (mm) technotes
==================



on 01 jan 2007 in macromedia.dreamweaver.appdev, murray *ace* wrote:

> can explain how email pattern works, please?
>
> $pattern = '/^[^@]+@[^\s\r\n\'";,@%]+$/';

'' - delimit string php
// - delimit regular expression (regex)
^ - beginning of string
[^@]+ - [] define group; in context, ^means not; + means @
least 1 of preceding group. whole thing means 'at least
one character not @ sign'.
@ - character literal, @ sign
[^\s\r\n\'";,@%]+ - yet group. again, ^ means not. "\"
used escape character, follows:
\s: whitespace (any non-character value)
\r: carriage return (0x0d)
\n: linefeed (0x0a)
\': single quote
the rest character literals; + again means 'at least one...'
$ - end of string

so, translated english (give or take):
start @ beginning of string. has have @ least 1 non-@
character, @ sign, @ least 1 character not
whitespace, cr, lf, single or double quote, semicolon, comma,
an @ sign or % sign, after string can end.

--
joe makowiec
http://makowiec.net/
email: http://makowiec.net/email.php


More discussions in Develop server-side applications in Dreamweaver


adobe

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial