Could someone please help me with creating a regex that will validate user input for a name field?
This is what I have so far. See anything missing? The special characters listed are for matching common european characters used in names. I'm not too worried about complete localized names unless there is a simple way to do this.
Current Regex Pattern: ^([A-Za-z�-��-��-� '`\\.,])+
Thanks!
Online collaboration made simple: <a href="http://www.rallypointhq.com" target="_blank" rel="nofollow">http://www.rallypointhq.com</a>
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35247
7
posted
0
You can catch all letters, accented or not, by using a shorthand like "\p{L}". It's explained in the javadocs for java.util.regex.Pattern.