Adam has asked for the wisdom of the Perl Monks concerning the following question:
Normally I would just construct the regex my self, but this one seems a bit complex, and if someone else has already solved it, I'd rather go with a proven solution. That said, I need a regex (or whatever) to split up a name string into its first and last halfs. Any middle name/names would be considered part of the first name, as would titles like Junior, Senior, Doctor, etc. Worse -- since some last names have spaces in them, I can't just split on the last space.
Examples of name strings that are considered legit, I italized the last names for clarity:
- Catherine Zeta-Jones
- Jean Claude Van Damme
- George W. Bush, Jr
- Madonna
- Randal L. Schwartz
- joe schmoe
Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Name Parsing
by lhoward (Vicar) on Jan 03, 2001 at 01:06 UTC | |
(Ovid) Re: Name Parsing
by Ovid (Cardinal) on Jan 03, 2001 at 01:06 UTC | |
Re: Name Parsing
by boo_radley (Parson) on Jan 03, 2001 at 01:04 UTC | |
($code or die) Re: Name Parsing - TPJ rules!
by $code or die (Deacon) on Jan 03, 2001 at 07:37 UTC |
Back to
Seekers of Perl Wisdom