From: Todd Burch Date: 2007-08-19T01:39:43+09:00 Subject: Is this the perfect regex for validating first & last names? Perhaps a fairly bold statement, coming from a novice regex'er. :) I'm creating a form (php) and have conjoured up this regex. My objective with this regex is to be sure I get a valid person's name. With that, I am assuming a real name does not contain 0-9, punctuation chars, programming symbols, and so on. I'm allowing more than one part names, like "Mary Beth" and "de la Cruz", and I'm being flexible in case the use more than one blank between names. I've included all the diacritics I could find (except the a-e character that is merged - is this still in use?) Anyway, feedback is appreciated. Here it is: function valid_name($name) { return eregi("^(([a-záàâäãåçéèêëíìîïñóòôöõúùûüßÿ])+( ?)*)+$", $name) ; } Please excuse for the php format. Prior to the function being called, whitespace is stripped front and back. eregi is a case insensitive match. A person certainly could enter a sentence or phrase (w/o punctuation, of course) and it would be accepted as a valid name. However, that's beyond the scope of what I'm trying to do with the regex. Fire away! Thanks, Todd -- Posted via http://www.ruby-forum.com/.