Skip to content

Instantly share code, notes, and snippets.

@priccis
Last active September 20, 2018 01:01
Show Gist options
  • Save priccis/80b059d22f2776e0fc240b489fba2a3a to your computer and use it in GitHub Desktop.
Save priccis/80b059d22f2776e0fc240b489fba2a3a to your computer and use it in GitHub Desktop.
Find & Replace with regex

How to find and replace using regex to replace by group

(At least in VSCode)

  • use () to capture the group in find
  • replace with that group using $<number-of-group>

Example

Original:

"JOV":{"Dir": {"":"1011011"}}

Find: {"":"([01]+)"}

Replace: "$1"

Product:

"JOV":{"Dir": "1011011"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment