Marc's Notes

VSCode Regex Group Reference in Find and Replace


Today I learned (TIL) that you can reference regex groups in the "Find and Replace" search of VSCode.

For example, if you want to find a certain HTML tag to replace it with a different one, you could use the following regex expression in the search


and use the captured group $1 in the replacement like this:


Ensure that you enabled regex syntax using the button in the search field on the right side.