in reply to Re: In place replace, ignoring between quotes (one regex)
in thread In place replace, ignoring between quotes

even shorter and more general in usage:

DB<229> $_=$str0 => " bla0 \"ignore a1\" bla1 \"ignore a2\" bla2" DB<230> s/("[^"]*")|a/ $1 or 'A' /ge => 5 DB<231> $_ => " blA0 \"ignore a1\" blA1 \"ignore a2\" blA2"

or for the OP

DB<226> $_=q{cd / ; /path/to/R/R_latest --vanilla --args "fName='rGS +DPlan';jobCode=682718;jobId=6827181;" < job682718.R > job_6827181.txt +} DB<227> s/("[^"]*")|;/ $1 or '&&' /ge => 2 DB<228> $_ => "cd / && /path/to/R/R_latest --vanilla --args \"fName='rGSDPlan';j +obCode=682718;jobId=6827181;\" < job682718.R > job_6827181.txt"

Cheers Rolf

( addicted to the Perl Programming Language)