| Title |
Test
Find
Pattern Title
|
| Expression |
^[a-zA-Z]+((((\-)|(\s))[a-zA-Z]+)?(,(\s)?(((j|J)|(s|S))(r|R)(\.)?|II|III|IV))?)?$ |
| Description |
This regex validates a persons last name. Acceptable names can include compound names seperated by a hyphen or a space. |
| Matches |
Jones, Jr | Casey-Jones | Casey-Jones, IV |
| Non-Matches |
Jones, IV. | Jones , Jr | Casey-Jones-Hall |
| Author |
Rating:
Not yet rated.
s l
|
| Source |
|
| Your Rating |
|
Title: Fix for Apostrophes
Name: Dave B.
Date: 9/27/2004 8:21:13 PM
Comment:
A good effort on hyphenated names and suffixes. However, it fails on something as simple as O'Callahan. Also, doesn't seemt o work for the suffixes it claims it does. I made the following modifications for the apostrophe:
^[a-zA-Z']+((((\-)|(\s))[a-zA-Z']+)?(,?(\s)?(((j|J)|(s|S))(r|R)
(\.)?|II|III|IV))?)?$