I should have posted some "rules" with this...
assuming:
- a SPACE is used to delimit first from last name [Walter Torres]
- a HYPHEN is used to separate a dual name (British style) [Conrad-Smyth]
- an APOSTROPHE is used in many Irish and Scotish names [O'Reilly]
- a PERIOD is used in titles, suffixes [Dr. Sr. Jr.]
- a PERIOD is used for Initials [Walter G. Torres]
then...
- allow apostrophes, but only if preceded *and* followed by a Alpha/Extend
- allow hyphen/dash, but only if preceded *and* followed by a Alpha/Extend
- allow PERIOD, but only if preceded by a Alpha/Extend *and* followed by a
SPACE or EOS
- allow SPACE, but only if preceded *and* followed by a Alpha/Extend
also...
- allow x80 thru xFF
I've come up with this...
/^([a-z\x80-\xFF]+(. )?[ ]?)+$/i
|_____________||___||__| ^
^ ^ ^ |
| | | |-------- whole block ONE or more times
| | |
| | |---- SPACE - ZERO or ONE times
alpha & extended |
ONE or more |-------- PERIOD - ZERO or ONE times
but I can't seem to figure out how to get the HYPEN & apostrophe rules in
here.
But this does allow multiple spaces - which It really shouldn't but...
It also lets me add SPACEs at the end, oh well...
Any ideas?
Thanks
Walter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php