CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 14:17:49 GMT
server: Fly/6f91d33b9d (2025-10-08)
content-type: text/html; charset=utf-8
content-encoding: gzip
via: 2 fly.io, 2 fly.io
fly-request-id: 01K7CCHTDPAFWP5JQHS7T3EWRP-bom
Search and replace with regular expressions in VS Code | Simon Willison’s TILs
Search and replace with regular expressions in VS Code
I wanted to replace all instances of this:
`#90 <https://github.com/simonw/sqlite-utils/issues/90>`__
With this:
: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:
`#(\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:
:issue:`$1`
Here the $1
means "the first thing captured with parenthesis".
The resulting change can be seen in commit e83aef95.
Related
- sphinx Using sphinx.ext.extlinks for issue links - 2021-02-17
- zsh Passing command arguments using heredoc syntax - 2022-07-07
- bash Finding CSV files that start with a BOM using ripgrep - 2021-05-28
- gpt3 Reformatting text with Copilot - 2022-12-09
- sqlite Fixing broken text encodings with sqlite-transform and ftfy - 2021-01-18
- git git bisect - 2022-10-29
- bash Skipping CSV rows with odd numbers of quotes using ripgrep - 2020-12-11
- html Scroll to text fragments - 2023-08-08
- bash Escaping a SQL query to use with curl and Datasette - 2020-12-08
- graphql Using curl to run GraphQL queries from the command line - 2022-02-21
Created 2021-08-02T14:30:11-07:00 · Edit