Chris W. Parker wrote:

CPT John W. Holmes <mailto:[EMAIL PROTECTED]>
    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].

Would probably be better to use \w, but best overall to just use preg_match(). The preg_* functions are faster than the ereg* functions...


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?

I looked through 40 pages of archives and couldn't find it either. :)


It had to deal with validating an entire name and capitalizing it with the whole McNab vs MacNab vs O'Reilly vs Marco de Blabla or whatever.

If I find it, I'll forward it your way.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to