Title |
Test
Find
Pattern Title
|
Expression |
(?<FirstName>[A-Z]\.?\w*\-?[A-Z]?\w*)\s?(?<MiddleName>[A-Z]\w+|[A-Z]?\.?)\s(?<LastName>(?:[A-Z]\w{1,3}|St\.\s)?[A-Z]\w+\-?[A-Z]?\w*)(?:,\s|)(?<Suffix>Jr\.|Sr\.|IV|III|II|) |
Description |
Getting closer now... this one has the functionality of the previous two and matches on names like "Jill St. John" as well. |
Matches |
David F. Walker | Norm MacDonald | Jill St. John |
Non-Matches |
oscar peterson |
Author |
Rating:
Not yet rated.
David Walker
|
Source |
|
Your Rating |
|
Title: The beginning of a sentence (or a title) messes things up
Name: Scott
Date: 5/6/2009 1:31:35 PM
Comment:
President George Washington was the first president.
Actress Catherine Zeta-Jones is really hot.
These return incorrect matches - is there some way you can start the match on the LAST capitalized word, then work backward? I would take a stab at it, but my RegEx-Fu is very weak. :)
Title: The beginning of a sentence (or a title) messes things up
Name: Scott
Date: 5/6/2009 1:31:27 PM
Comment:
President George Washington was the first president.
Actress Catherine Zeta-Jones is really hot.
These return incorrect matches - is there some way you can start the match on the LAST capitalized word, then work backward? I would take a stab at it, but my RegEx-Fu is very weak. :)
Title: Mr.
Name: Florin G
Date: 7/7/2006 1:51:10 PM
Comment:
Warning: preg_match(): Compilation failed: unrecognized character after (? at offset 2