Problem with regex

From: Date: Tue, 25 Sep 2001 10:36:26 +0000
Subject: Problem with regex
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-68678@lists.php.net to get a copy of this message
Hi, The following works. But I wouldn't allow users to use something like -. --- _- in $TestPwd. How can I implement this ? --- Steve Edberg <sbedberg@ucdavis.edu> wrote: > if (ereg('^[a-z][-a-z0-9\._]*[a-z]$', $TestPwd)) { > echo "Good"; > } else { > echo "Bad password $TestPwd"; > } ===== mailto: oliver@ertl.co.za www.ertl.co.za __________________________________________________ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com

« previous php.general (#68678) next »