Using RegEx groups for Search & replace in VS Code
Briefly

In the 'Replace' input box, we can enter the text that we want to replace the matching text with. We can also use matches from the search section if we want to. $0 refers to the whole match; and $1, $2, etc., refer to the capture groups.
If you need it, following is a refresher on some special characters that can be used to match certain positions or conditions in the text, pretty standard RegEx items: ...
Read at Wisdom Geek
[
add
]
[
|
|
]