How do we delete entire lines containing a certain substring in VSCode with the
Example Scenerio in VSCode
I had a JSON file where I wanted to delete every line containing the line
code where every value of
code was different.
Using regex and VSCode Find in File function.
- Open VSCode’s
Search: Find in Files. (cmd+f)
- Click on the regular expression button
- Write the regular expression
[STRING]is your substring. It would be
^.*code.*$\nin our example scenario
- Replace all with an empty line.