in reply to Re^2: Need help with replace or substitute
in thread Need help with replace or substitute

Or with one line of regex code:

$string =~ s/("[^"]*")/local $_=$1; s!,!#!g; $_ /ge;

Yes it won't handle escaped double quotes but if you don't have that edge case it will never matter.

Replies are listed 'Best First'.
Re^4: Need help with replace or substitute
by Anonymous Monk on Apr 13, 2008 at 10:20 UTC
    the output with ur regex coming in this code snip as: "the, sample, string",345,43","A, next , string",12,-90 "the# sample# string",345,43"#"A, next , string",12,-90

      That's because your quoting is invalid.

Re^4: Need help with replace or substitute
by Anonymous Monk on Apr 13, 2008 at 10:23 UTC
    thanks this is much appreciated as we can't use any extra CPAN modules other than which are installed there due to some policy voilation.