Reputation: 418
I have the following text:
"BOONS": ["Debarrier+Rainbow Shift"
},
"CLUTCH_BOONS": [
"Boost+Wall"
],
Regex:
(?<=[A-Z a-z])(\+)(?=[A-Z a-z])/g
Using That I am capable of capturing all of the +'s which is great, but I only want to capture the + signs inside of "CLUTCH_BOONS", I have tried really hard with little success.
I also want to close the "BOONS" bracket, I managed to get the left side going properly but cannot get the right quote
(?<=.*)(\")(?=.*\})
end result should look like this
"BOONS": ["Debarrier","Rainbow Shift"]
},
"CLUTCH_BOONS": [
"Boost","Wall"
],
(I was trying to use Atom / regexr to fix problematic json)
Upvotes: 1
Views: 49
Reputation: 1689
For the plus signs, you can use this regex:
"\w+": \[\s*"\w+\K\+
see here:
and for the second one:
"(\s*)},
see here:
Upvotes: 1