in reply to In place replace, ignoring between quotes
outputs$_ = q(aaa; ; bbb ; "ccc ; ddd ;" ee;e ";" fff ;); s/(".+;.+"|;)/$1 ne ';' ? $1 : '&&'/ge;
so It fit the authors task, if he doesn't have anyaaa&& && bbb && "ccc ; ddd ;" ee;e ";" fff &&
seems to me that, these should be processed with toggles =_=; " ; " ; " ; " ;
$b = 0; $_ = q(aaa; ; bbb ; "ccc ; ddd ;" ee;e ";" fff ;); $a = join '', map {$b =!$b if /"/; s/;/'&&'/ unless $b; $_} split //; output: aaa&& && bbb && "ccc ; ddd ;" ee&&e ";" fff &&
|
|---|