RE: [PHP] validate names with regex

From: Date: Wed, 12 Nov 2003 23:12:26 +0000
Subject: RE: [PHP] validate names with regex
Groups: php.general 
Request: Send a blank email to php-general+get-169395@lists.php.net to get a copy of this message
CPT John W. Holmes <mailto:holmes072000@charter.net> on Wednesday, November 12, 2003 2:09 PM said: > $match = "^[a-z]+([- ]{1}|(\\\'))?[a-z]+$"; > > along with eregi(), but it can (should) be easily adapted to a syntax > compatible with preg_match(). I'm wondering two things: 1. Is there a performance difference between ereg() and eregi()? I'm thinking it might be better to change [a-z] to [\w]. 2. I know \w covers [a-zA-Z] but does it cover anything else? > I remember a large discussion about this a while back. Archives may be > useful. I couldn't find anything, but I was pretty sure it had been discussed before as well. Happen to know the subject of the thread? Chris. -- Don't like reformatting your Outlook replies? Now there's relief! http://home.in.tum.de/~jain/software/outlook-quotefix/

« previous php.general (#169395) next »