The context for how and why is too niche for me to go in to here, but I had a bunch of files where I needed to change all instances of this:
Except for each instance, the id value (the number) was different.
I wanted to keep the number in there, but change the text that wraps it.
Because I needed to replace text on either side of the number, a simple find-and-replace term wasn’t going to work. I needed regex.
To turn on search using regex, you want to make sure this option is selected:
To replace the text on either side of text, you want a regular expression that follows this pattern:
AFTER_TEXT match the text on the left and the right of the text you want to wrap-replace.
Then, in the Replace input of the Search UI, you add a
$1 to wherever you want the original text to go.
For my case above, I used this: