Wow! I didn’t realise using back-references in the search string was done!
Now… it’s very possible I’ve misunderstood your highlighter… but I just wanted to try out the backref feature anyway…
First highlight example
First highlighter example
I may also have interpreted nested priorities wrong, but are those back-references inside the groups they reference? … probably not, but that could explain the slowdown if it were doing that and not breaking :-)
Anyway, I was wondering if changing to these 2 highlights instead of that 1, speeds it up? Unless it’s way off the mark regarding what you require…
This should only highlight lines starting with, 1-5 + or = characters, and ending identically.
This should only match lines that start with 20 or more, “-“, “_” or “=” characters, and aren’t immediately proceeded by a whitespace char. Hopefully, they aren’t too far off!