I'm using Sublime to do some simple text editing.
Now I have a bunch of URLs and I have to add text at those who end with numbers, but not those URLs who end with text.
How can I do this in bulk?
eg.
http://www.example.com/pt/abcde/123456
http://www.example.com/pt/fghi/789012/addtext
http://www.example.com/pt/jklmn/345678/addtext
http://www.example.com/pt/opqr/901234
http://www.example.com/pt/stuvz/567890/addtext
I need it to be
http://www.example.com/pt/abcde/123456/addtext
http://www.example.com/pt/fghi/789012/addtext
http://www.example.com/pt/jklmn/345678/addtext
http://www.example.com/pt/opqr/901234/addtext
http://www.example.com/pt/stuvz/567890/addtext
I have thousand of lines so I'd like to bulk edit only the lines that end with numbers.
At the moment I'm able to bulk edit all the lines using the function ctrl+shift+L and then paste the /addtext
, but this will add the text to all the lines, resulting in a double /addtext
to the lines that have already the /addtext
.
You could simply use a regex to do the job. This would work for example:
Find: ^(http.*/\d+)$
Replace with: $1/addtext