Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name = Name.Trim();
- arrNames = Name.Split(' ');
- if (Name.Length > 0) {
- GivenName = arrNames[0];
- }
- if (Name.Length > 1) {
- FamilyName = arrNames[arrNames.Length - 1];
- }
- if (Name.Length > 2) {
- MiddleName = string.Join(' ', arrNames, 1, arrNames.Length - 2);
- }
- /^ s*
- (?:((?:Dr.)|(?:Mr.)|(?:Mr?s.)|(?:Miss)|(?:2ndsLt.)|(?:Sen.?))s+)? # prefix
- ((?:w+)|(?:w.)) # first name
- (?: s+ ((?:w.?)|(?:ww+)) )? # middle initial
- (?: s+ ((?:[OD]['’]s?)?[-w]+)) # last name
- (?: ,? s+ ( (?:[JS]r.?) | (?:Esq.?) | (?: (?:M)|(?:Ph)|(?:Ed) .?s*D.?) |
- (?: R.?N.?) | (?: I+) ) )? # suffix
- s* $/x
- Name Parts | Correct | Percent of Names in DB
- 2 100% 48%
- 3 98% 42%
- 4 70% 9%
- 5 45% 0.25%
Add Comment
Please, Sign In to add comment