Title |
Test
Find
Person's Full Name with salutation and suffix
|
Expression |
/^(?P<salutation>(Mr|MR|Ms|Miss|Mrs|Dr|Sir)(\.?))?\s*((?<first>[A-Za-z\-]*?) )?((?<second>[A-Za-z\-]*?) )?((?<third>[A-Za-z\-]*?) )?(?(?!(PHD|MD|3RD|2ND|RN|JR|II|SR|III))(?<last>([A-Za-z](([a-zA-Z\-\']{1,2})[A-Za-z\-\'])?[a-zA-Z\-\']+)))( (?P<suffix>(PHD|MD|3RD|2ND|RN|JR|II|SR|III)))?$/ |
Description |
A pattern for matching both simple, and complex names. Will match up to 4 names within a single name. This is a regex expression I created using some of the expressions I have found here, and other places on the web. It has named patterns to make it easier to separate the parts in your application. |
Matches |
Bob Smith | Bob A. Smith | Dr. Travis Arthur John-Dale O'Brien III | Travis O'Brien III |
Non-Matches |
\BobSmth | Akjsdfkj/& | My{Name} |
Author |
Rating:
Not yet rated.
travis weerts
|
Source |
|
Your Rating |
|
Title: Mr
Name: sldkfj
Date: 3/30/2022 6:16:15 AM
Comment:
lsdkfj
Title: NOT VALID!
Name: Geco
Date: 2/5/2009 2:07:50 AM
Comment:
NOT VALID!