Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
[,]{1}[\s]*?\"attr\"[ ]*?[:][ ]*?\".*\"[^,]|\"attr\"[ ]*?[:][ ]*?\".*\"[,]{0,1}
/
g
Input 1
1
New
{ "attr": "MYVALUE", "anotherAttr0": "foobar", "attr": "MYVALUE2", "anotherAttr1": false, "anotherAttr2": "300", "attr": "MYVALUE3" }
Substitution
{ "attr": "MYVALUE", "anotherAttr0": "foobar", "attr": "MYVALUE2", "anotherAttr1": false, "anotherAttr2": "300", "attr": "MYVALUE3" }