From: Peter Brawley Date: May 20 2006 5:12pm Subject: Re: Find invalid email formats using MySQL query. List-Archive: http://lists.mysql.com/mysql/198148 Message-Id: <446F4E14.4050402@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=======AVGMAIL-446F4E1415C7=======" --=======AVGMAIL-446F4E1415C7======= Content-Type: multipart/alternative; boundary=------------090703070902010404090206 --------------090703070902010404090206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Yesmin Patwary wrote: > Dear All, > > My contact table has email field which contains many invalid email addresses. I find them using following php function. Is there a way to do that check in MySQL query? > > function emailValidate ($str) > { > $reg = "^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+(\.[a-zA-Z0-9-]+)+$"; > if (eregi($reg, $str)) { > return true;//-- good email > }else{ > return false;//--bad email > } > }//--close function > Works if you change \. to [.period.]. PB ----- > Thanks in advance for any comments or help. > > > --------------------------------- > Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.392 / Virus Database: 268.6.1/344 - Release Date: 5/19/2006 > --------------090703070902010404090206 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Yesmin Patwary wrote:
Dear All,
   
  My contact table has email field which contains many invalid email addresses. I find them using following php function.  Is there a way to do that check in MySQL query?
   
  function emailValidate ($str)
 {
    $reg = "^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+(\.[a-zA-Z0-9-]+)+$";
    if (eregi($reg, $str)) {
         return true;//-- good email
     }else{
         return false;//--bad email
     }
  }//--close function
  
Works if you change \. to [.period.].

PB

-----
  Thanks in advance for any comments or help.

		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.
  

No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.6.1/344 - Release Date: 5/19/2006
--------------090703070902010404090206-- --=======AVGMAIL-446F4E1415C7======= Content-Type: text/plain; x-avg=cert; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: "AVG certification" No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.6.1/344 - Release Date: 5/19/2006 --=======AVGMAIL-446F4E1415C7=======--