My document contains several instances of code blocks similar to:
{% highlight %}
{% endhighlight %}
In Atom.io, I am trying to write a regular expression search to capture them.
My first attempt:
{% highlight .* %}([\S\s]+){% endhighlight %}
The problem is that in one document there are several code blocks, as well as the first block of code to the last, all in one match.
I would like to exclude the character {:
{% highlight .* %}([^\{]+){% endhighlight %}
But the problem is that some of the code blocks contain valid characters {(for example, function(){ ... }).
source
share