RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$
Description
Person's name (first, last, or both) in any letter case. Although not perfect, this expression will filter out many incorrect name formats (especially numerics and invalid special characters).
Matches
T.F. Johnson | John O'Neil | Mary-Kate Johnson
Non-Matches
sam_johnson | Joe--Bob Jones | dfjsd0rd
Author Rating: The rating for this expression. Robert Dugre
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: ******&#%$*&#%$*&#%$
Name: *&#%$*&#%$*&#%$*&#%$*&#%$*&#%$
Date: 3/17/2015 4:57:21 AM
Comment:
*&#%$*&#%$*&#%$*&#%$*&#%$


Title: Thanks a lot
Name: Frenz
Date: 1/18/2012 7:00:40 AM
Comment:
Would be great if you could include check for minimum characters. For example, if my input string is just a single letter, say, C. Then, the regex fails.


Title: Thanks a lot
Name: Frenz
Date: 1/18/2012 7:00:16 AM
Comment:
Would be great if you could include check for minimum characters. For example, if my input string is just a single letter, say, C. Then, the regex fails.


Title: Thanks a Lot
Name: Mady
Date: 3/19/2011 12:29:16 PM
Comment:
I was searching for this all over internet. This helped me a lot. Thank you very much.


Title: How do I change this to allow numbers too??
Name: Tom
Date: 4/1/2008 2:53:36 PM
Comment:
How do I change this to allow numbers, too?? to make it usable for comments fields?? Thank you, Tom


Title: How do I change this to allow numbers too??
Name: Tom
Date: 4/1/2008 2:53:27 PM
Comment:
How do I change this to allow numbers, too?? to make it usable for comments fields?? Thank you, Tom


Title: stops short
Name: dan barnes
Date: 3/21/2004 4:10:03 PM
Comment:
I noticed it doesn't work with suffixes like John Doe, Jr. John Doe III That would be a great addition.


Title: Scandinavian characters aren't supported
Name: Stig-Arne Grönroos
Date: 11/12/2003 9:04:57 AM
Comment:
The characters "ÅÄÖåäö" are quite common in scandinavian names, so if you don't want to filter out all your scandinavian clients you might want to add them


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials