Sublime Regex Search and Replace


Trying to use Sublime to update the urls of only some lines in a sql table dump.

in this case the line that I need to single out has the string ‘themo_showcase_\d_image’ which is easy to match. In the same string what I actually need to replace is the url column so that it reads ‘‘ to ‘

Anyone able to help shed some light on this? I’ve got thousands of these insert records that I need to modify.


original string:

(‘8630’, ‘1328’, ‘themo_showcase_1_image’, ‘‘),


(‘8630’, ‘1328’, ‘themo_showcase_1_image’, ‘‘),


It’s not clear what you want. Can you provide sample inputs and expected outputs?
if the string you want to match is always in the tail part of the same URL, something like (http)(://[^<>"']+/themo_showcase_\d_image) could be replaced with $1s$2 (not sure what precise syntax Sublime uses).
just updated the question with the original string and expected output after this operation has been correctly. The idea is use the regex to filter out the strings that I don’t want to modify, and then replace the protocol of the url of what’s left.
– Nebri
42 mins ago



  • Find: 'themo_showcase_\d_image', 'http\Ks you could use \d+ if there are more than 1 digit
  • Replace: LEAVE EMPTY