U Rogel
U Rogel

Reputation: 1941

VS Code, find/replace access find results in the replace field

I have phone numbers on my file and I would like to surround each of them with braces, so if I have this:

"+49-1111"
"+49-2222"

I would like to run a replace operation and to get this:

["+49-1111"]
["+49-2222"]

Is that possible with the current vs code find/replace action? If it is a dup sorry but I could find any explanation anywhere. Thanks

Upvotes: 0

Views: 61

Answers (1)

SOtone
SOtone

Reputation: 76

This is more relevant to regular expression.

Find ("\+\d{2}-\d{4}"), replace the occurrences with [$1]

Be sure to turn the "Use Regular Expression" switch on.

Upvotes: 2

Related Questions