Yeeech. I guess when all you have in your toolbox is a hammer, everything gets a little banged up, regardless.split /(\".*?\"(?=,))|(.*?(?=,))|(.*?(?=\n))/
Had you considered using @result = /pattern/g instead of split? What I've found is that in general, if it's easier to talk about what you're keeping than what you're throwing away, the match wins over the split.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl is returning... odd results... from regular expressions. Things matching when they shouldn't, and stuff like that.
by Groxx (Novice) on Jan 11, 2007 at 08:07 UTC |