I'm editing a javascript file in Python, I've done most places but I'm stuck at a critical point, can you help?
The part I'm trying to edit:
"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
}
There are many more blocks like this in the javascript file. i: "garson2"
term is also not fixed but I can get this value. Using the term i: "garson2"
, I want to make r: "none"
variable r: "inline"
in the block where this term is. How can I do it? Note: The terms between r: "none"
and i: "garson2"
are also variable.
You may use positive look ahead assertions for this and use
re.sub()
to replace.Demo
Example
Output