[pmwiki-devel] email verification regex question

John Rankin john.rankin at affinity.co.nz
Tue Oct 16 17:41:20 CDT 2007


On Wednesday, 17 October 2007 6:55 AM, Hans <design5 at softflow.co.uk> wrote:
>I like to ask the regex experts if I got a regex right, to be
>used for email verification.
>The email form field gets checked with preg_match against this
>pattern:
>"/^([\w+*!%&`^~$=/|{}-][.]?)+[\w+*!%&`^~$=/|{}-]+@[\w.-]+\.[a-zA-Z]{2,4}$/i"
>
>This still will not catch any local part provided as a quoted string,
>which is apparently allowed for email addresses, but not much used.
>It shall allow alphanumeric and a number of special characters
>     _+*!%&`^~$=/|{}-
>in the local part, and prohibit dots at the beginning or the end of
>the local part, and repeated dots in the middle.
>it will also not catch any entries like:
>
>  Some Name <abcd.efgh at example.com> bla bla
>  
>I am not sure if this important or should be allowed as field entry.
>Or can this be achieved simply by omitting the  ^ $ beginning and end
>markers?
>At least it should catch any straight addresses without spaces.

The following links may help:
http://www.regular-expressions.info/email.html
http://regexlib.com/REDetails.aspx?regexp_id=711


>  
>
> Hans
>


-- 
JR
--
John Rankin

       \_      
        \)   
         \,\__/7
         /    /
        (   c'
         \  / 
     /,  /_/  
    |  & *   Wellington
    )  /    
   /  /,    
  /  (    
 |   /      
 \__/       
   V        






More information about the pmwiki-devel mailing list