I'm trying to temporarily deal with simple quoted strings by turning:
data: "this is a string" more: "this is another"
into...
data: "this is a string" more: "this is another"
I thought this would work:
s/(['"])([^\1]*)\1/${1}.despace($2).$1/gse;
sub despace {
my $t = shift;
$t =~ s/\s/ /g;
return $t;
}
... but it doesn't. It looks like the [^\1]* in the regex isn't working
right.
I can always split it into two, but I'm curious why the above doesn't work.
TIA.
- Bryan
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/