I don't know about regexes, Jeff Pinyan is the master and can probably give you the right answer.
But for me I can't understand the regex he made, and if your code will be read by someone else, I suggest the split for clarity and for speed (well this would need to be benchmarked but I'm sure it's faster) Split on " Simple regex to remove start and trailing space(s) and that's it It might not be a one liner, but it's easy to read/understand Etienne Pete Emerson wrote: > > Thank you all for your quick responses. > Splitting on the " was the key. > I'm intrigued by Jon Molin's response, though: > > my @ar = ($a =~ /((?:\"[^\"]*\"|[^\s]*))\s?/g); #should be possible to remove " > > s/\"//g foreach (@ar); > > print "$_\n" foreach (@ar); > > This works, too, but I don't understand what the ?: is for; > my Perl book says it doesn't do backreferences; what does that mean? > Oh, fun with regexes. :) > Pete > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Etienne Marcotte Specifications Management - Quality Control Imperial Tobacco Ltd. - Montreal (Qc) Canada 514.932.6161 x.4001 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]