Regexs baffle me. I have a situation where I have JSONs stored in a db. I need to go into the JSON string, find a part of it, and increment it.
In this case, the phrase I'm searching for is "selectedLib":"x"
where x is always a number (but a number that has, in this case, been wrapped in quotes and so is technically a string).
So, "selectedLib":"1"
, needs to become "selectedLib":"2"
, "selectedLib":"23"
needs to become "selectedLib":"24"
, and so on.
This is a real head-scratcher...
UPDATE table SET column+=1
).