First, when is it appropiate to use syn region
instead of syn match
? As a
rule of thumb: whenever you would expect the matched text to span several lines
(and you don't know how many). If you see yourself using .*
in the middle of a
syn match
rule, you should probably consider using syn region
instead.
So let's suppose we want to highlight "{{{begin ... end}}}" blocks, such as this:
{{{begin "But I must explain to you how all this mistaken idea of