All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
  Print view

State of email validation
Author Message
PostPosted: Fri Oct 22, 2010 3:37 pm 
Regular
User avatar
Offline

Joined: Mon Sep 18, 2006 10:01 pm
Posts: 255
The ATK email validator in 6.5 does not accept a upcase uppercase capital letters characters in email address.

This is a current survey of email validation, in comments in atkEmailAttribute code:

Code:
    /**
     * Checks e-mail address syntax against a regular expression.
     *
     * @param string $email e-mail address.
     * @return boolean e-mailaddress syntactically valid or not.
     * @static
     */
    function validateAddressSyntax($email)
    {
   
    /*
       The local-part of the e-mail address may use any of these ASCII characters:
      
      Uppercase and lowercase English letters (a-z, A-Z)
      Digits 0 to 9
      Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
      Character . (dot, period, full stop) provided that it is not the first or last character,
      and provided also that it does not appear two or more times consecutively.
      
      email validation regex codes:
      if (preg_match("/^[-_a-z0-9+]+(\.[-_a-z0-9+]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2,4}$/", $email))  //ATK 6.5
      $regexp = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/";
        if(preg_match("/^[a-zA-Z]\w+(\.\w+)*\@\w+(\.[0-9a-zA-Z]+)*\.[a-zA-Z]{2,4}$/", $_POST["email"]) === 0)
        if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){

        the winner:
        /^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i
        http://fightingforalostcause.net/misc/2006/compare-email-regex.php
       
        see dominic's is_email() parser, a bit more involved:
        http://www.dominicsayers.com/isemail/
       
   */
   
      //if (preg_match("/^[-_a-z0-9+]+(\.[-_a-z0-9+]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2,4}$/", $email))
      if (preg_match("/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i", $email))
      {
        return true;
      }
      else
      {
        return false;
      }
    }


Top
 Profile  
 

Re: State of email validation
PostPosted: Tue Sep 06, 2016 8:47 am 
Offline

Joined: Tue Sep 06, 2016 8:45 am
Posts: 1
Check this...regex email validation

Lee


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group