How would be the RegEx to make the string
'{"a":"st", "b":"EvalMe(nd)", "c":"th"}'
become
'{"a":"st", "b":nd, "c":"th"}'
?
How would be the RegEx to make the string
'{"a":"st", "b":"EvalMe(nd)", "c":"th"}'
become
'{"a":"st", "b":nd, "c":"th"}'
?
It looks like json
. So first using json library
(not sure how in Javascript) parse this value first "b":"EvalMe(nd)"
from the json
.
Then from there do a regex replace like below way and then update your json
.
output = "EvalMe(nd)".replace(/.*\((.*?)\).*/, "$1");
^^^^^ picking of nd is here
Here using regex it is capturing the nd
in group $1
and replace everything with empty, and keeping the group.
A simple find and replace is all you need
find: /"EvalMe\(([^()]*)\)"/
replace: \1
or $1