RE: [PHP] regex problem with '@'

From: Date: Thu, 05 Oct 2000 02:17:11 +0000
Subject: RE: [PHP] regex problem with '@'
Groups: php.general 
Request: Send a blank email to php-general+get-18693@lists.php.net to get a copy of this message
if you are ever having problems with recognizing characters then make a test page and put this into it: for($i=1; $i<=256; $i++) { if ($i<10) $n='00'.$i; elseif($i<100) $n='0'.$i; else $n=$i; echo '<br>ANSI '.$n.' --><b>'.chr($n).'</b><-- '; } this will make you a list of ALL ANSI characters. basing on it you can then specify the character you want by it's ANSI value, like chr('13') for a new line or chr('65') for a Capital A (I think) etc... So your ereg is looking then smarter like this: ereg(chr(65), $str) but, this is for testing and other complicated staff, usually a simple strstr() or str_replace is enough. Cheers! -----Original Message----- From: Tony Bailey [mailto:tony@jag-lovers.org] Sent: Wednesday, October 04, 2000 10:51 PM To: PHP General List. (E-mail) Subject: RE: [PHP] regex problem with '@' That would be useful if: a) I was validating an email which I am not b) it was a supported function which it is not (under the version I quoted in last mail) c) I understood it which I do not but probably will if I had the time to after solving the current problem :-) Ta anyway Tony On Wed, 04 Oct 2000 15:55:12 +0200, Wico de Leeuw wrote: > function Validate_Email ($email) { > return(preg_match("'^[a-z0-9_.=-]+@(?:[a-z0-9-]+\.)+([a-z]{2,3})\$'i", >$email)); > } > > >At 14:38 4-10-00 +0100, Tony Bailey wrote: >>Well tried all that still doesn't work. >> >>i.e. "\@" "[@]" and various other unlikely combinations >> >>Strange thing is that a similar eregi_replace does work using "\@" >> >>I should add that the antiquated server I am [trying] using this on has >>php 3.0.1 - and I can't get it changed so maybe there was a bug in such >>an early release? >> >>Tony >> >>--Original Message Text--- >>From: Maxim Maletsky >>Date: Wed, 4 Oct 2000 22:28:18 +0900 >> >>I think you should both read this: >>http://www.phpbuilder.com/columns/dario19990616.php3 >> >>Cheers! >> >> >>Maxim Maletsky - maxim@j-door.com >>Webmaster, J-Door.com / J@pan Inc. >>LINC Media, Inc. >>TEL: 03-3499-2175 x 1271 >>FAX: 03-3499-3109 >> >>http://www.j-door.com >>http://www.japaninc.net >>http://www.lincmedia.co.jp >> >> >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >>For additional commands, e-mail: php-general-help@lists.php.net >>To contact the list administrators, e-mail: php-list-admin@lists.php.net > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#18693) next »