arimetic operations on regex

Sometimes in files I want to run operations on a bunch of numbers such as adding an offset to all numbers maching a regex, to do this you can run a command like this

  
    :%s/\v"x":(\d+)/\="\"x\":".(1024-submatch(1))/g
  

edit this page