json - VIM: find all numbers in double quotes and remove double quotes -


i've accidentally formatted huge file incorrectly. have several hundred vars defined as:

"exportorder": "274" 

when need:

"exportorder": 274 

anyone know regex remove double quotes in each of these occurrences?

the sample data looks so:

{     "key": "date",     "name": "date",     "datatype": "date",     "exportorder": "274" }, {     "key": "coordinates",     "name": "coordinates",     "datatype": "geopoint",     "exportorder": "275" }, 

and on..

i can remove first quote with: :%s/order": "/order": /g

but can't figure out 2nd quote.

thanks

you can use this:

:%s/"\([0-9]\+\)"/\1/g 

i'm capturing number within quotes in capturing group one.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -