$re = '/r: "none"(?=[^{}]+i: "garson2")/m';
$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
}';
$subst = "r: \"inline\"";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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 PHP, please visit: http://php.net/manual/en/ref.pcre.php