in reply to Dealing with Names
Hm, are you looking for something like this?
my @names = ( 'Daniel R Von Vanderschmidt', 'Daniel Von Vanderschmidt', 'Daniel De La Silvia', 'Daniel De Silvia', 'Daniel La Silvia', ); for my $name (@names) { my @comps = $name =~ m{(?:Von|De La|La).*|\w+}g; print "[$_]" for @comps; print "\n"; }
The output is:
[Daniel][R][Von Vanderschmidt] [Daniel][Von Vanderschmidt] [Daniel][De La Silvia] [Daniel][De][Silvia] [Daniel][La Silvia]
Update: Added the .* after re-reading your example output.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dealing with Names
by walkingthecow (Friar) on Aug 28, 2008 at 18:43 UTC | |
by Your Mother (Archbishop) on Aug 28, 2008 at 19:15 UTC | |
by kyle (Abbot) on Aug 28, 2008 at 18:57 UTC |