On Fri, Sep 23, 2011 at 10:41 AM, justin <jus...@justinhileman.info> wrote:

> You might be better off enumerating "goodness"...
>
>    /^
>        ([A-Z][a-z]+)+                # first name, consisting of any
> number of AbAbc, handles "LaDawn"
>        \s+
>        (                             # middle name (optional)
>            [A-Z]                     # at the very least, has a capital
> letter
>            (
>                \.                    # ends with either a dot
>                |                     # ... or ...
>                [a-z]+([A-Z][a-z]+)?  # the rest of a name
>            )?                        # but again, that's totally optional
>            \s+
>        )?
>        ([A-Z][a-z]+)+                # and a last name, following the
> same convention as the first (McGraw)
>    $/x
>
>
> -- justin
>
>
>
Interesting, thanks.

As it happens, the last, middle and first names are separate fields.
(Actually I am labelling them "surname(s)" and "given name(s)" just to keep
it confusing.)

btw McDonald and its brethren pass the test I've written. But so does
McdoNald, which is why I am thinking, ok, you are only so clever and if they
want to input data that is wrong in some way or other, at some point you
can't stop 'em. You did your due diligence.

-- 
David Mintz
http://davidmintz.org/
It ain't over:
http://www.healthcare-now.org/
_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation

Reply via email to