in reply to Re^3: split function using multiple delimiters
in thread split function using multiple delimiters

Lots of good ideas, though split can be a dog with large volumes of data, like a book written at a frat party. I can't think of how to do it without using a match to follow, but a nice 2am ugly regex can do it all(tags have been pre-stripped):

$_ = "Allan Wigfield, Susan L. Klauda, and Jenna Cambria";

   while( s/^(\w+(?:\s+\w\.)?)\s+(\w+)(?:,\s+(?:and\s+)?)// )
     { print "First Name: $1\nLast Name: $2\n";}

It's ugly, but it works.
  • Comment on Re^4: split function using multiple delimiters