in reply to Splitting on escapable delimiter
# Extract fields my @fields = /((?:[^#@]+|#.)*)/sg; # Remove seperators my $ff = 0; @fields = grep $ff^=1, @fields; # Unescape s/#(.)/$1/sg for @fields;
or use Text::CSV
Updated to remove empty elements were being placed in @fields.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Splitting on escapable delimiter
by Roy Johnson (Monsignor) on Mar 28, 2008 at 18:24 UTC | |
by ikegami (Patriarch) on Mar 28, 2008 at 21:10 UTC | |
by Roy Johnson (Monsignor) on Mar 31, 2008 at 19:55 UTC | |
by ikegami (Patriarch) on Mar 31, 2008 at 21:49 UTC |