Newsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.
Search and replace with regular expressions in VS Code#
I wanted to replace all instances of this:
1`#90 <https://github.com/simonw/sqlite-utils/issues/90>`__With this:
1:issue:`90`I used the VS Code’s Find and Replace tool with regular expression mode turned on (the .* button). I used the following for the find:
1`#(\d+) <https://github.com/simonw/sqlite-utils/issues/\1>`__Note the \1 reference to say “the same thing I captured earlier with parenthesis”. Then I used this as the replace string:
1:issue:`$1`Here the $1 means “the first thing captured with parenthesis”.

The resulting change can be seen in commit e83aef95.
Newsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.