Sublime Forum

Loop or "batch command" - Search and Replace (especially regex) , in order to run multiple times the operation

#1

hello. I just run a regex such as this:

Search: \s\S*(?:<p class="best">|\G)(?:(?!</p>).)*?\s\K\s+|(?<=<p class="best">)\s+|\s+(?=</p>)
Replace by: (Leave Empty)

This regex will delete/eliminate all the empty spaces from the tag <p class="best">. But it cannot be done from the first attempt, so I must run many time this regex formula.

I’m thinking of doing something like a “loop” or "batch command’, in order to run multiple times the operation, until is finally done all the “replaces”.

Ho can I do this?

0 Likes