in reply to Improved regexp sought
The split is on plus or apostrophes not preceded by a question mark. The map turns "?'" into just "'".my @fields = map {s/\?'/'/g; $_} split /\+|(?<!\?)'/, $line;
Update: It's probably clearer (and thus better) to say
my @fields = split /\+|(?<!\?)'/, $line; s/\?'/'/g for @fields;
|
|---|