I'm trying to require users to input proper names with capitalization that
conforms to convention. So, you can't go e. e. cummings on me, and you can't
be JOHN SOMEBODY either. And you can't have your caps lock on and enter jOHN
sOMEBODY. That much is pretty easy, but I am finding the more subtle cases
pretty hard.

So far, I have

        /\b[a-z][A-Z]+|\b[A-Z]{2,}+|^[a-z ]+$/

to test against (false is good). This works on all the cases I have tested
except "cuMmings," which gets by. But I am thinking, maybe enough is enough;
you can't control everything.

Just wondering if anyone has tackled this before or has any thoughts.

btw this is on top of other whitelist-style validation.

-- 
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