Regular expression search avoid nested results
问题 My document contains several instance of code blocks looking like: {% highlight %} //some code {% endhighlight %} In Atom.io, I am trying to write a regex search to capture those. My first try was: {% highlight .* %}([\S\s]+){% endhighlight %} The problem is because there are several code blocks in the same document, it also catches the first code block until the last one, all in one match. I though to exclude the { character: {% highlight .* %}([^\{]+){% endhighlight %} But the problem is