use strict;
my $str = '"589": {
p: "no-repeat",
c: 97,
q: "100% 100%",
bS: 420,
cP: "garson",
r: "none",
d: 138,
cQ: 1,
gg: "0",
cR: 1,
aP: "pointer",
h: "553",
i: "garson2",
bF: "578",
aI: 35,
j: "absolute",
x: "visible",
aA: {
a: [{
d: 1.1,
p: 1,
g: 1,
f: 1
}, {
p: 4,
h: "474"
}, {
p: 4,
h: "476"
}]
},
k: "div",
aJ: 35,
dB: "img",
z: 23,
Q: 16,
aK: 35,
R: "rgba(0, 0, 0, 0.411)",
S: 5,
a: 140,
aL: 35,
T: 4,
b: 2
}';
my $regex = qr/r: "none"(?=[^{}]+i: "garson2")/mp;
my $subst = 'r: "inline"';
my $result = $str =~ s/$regex/$subst/rg;
print "The result of the substitution is' $result\n";
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Perl, please visit: http://perldoc.perl.org/perlre.html