I would like to use a variable within a regular expression counter. I
tried the following, but it gave me a syntax error:

:syntax region Keyword start="^\w\+\s\+\z(\d\+\)"
end=#\(\s*\(".\+"\|'.\+'\).*\n\)\{\z1\}#

If I replace \z1 with 1 or some other number it works fine. I also
tried something like \{,20\} but then it will only do a greedy match
on the first line and skip the rest.

The region I'm trying to match is:

PRNEXCLUDED 0

or

SERVER 1  '0'

or

STALIST 6
 "STA1" "n" "" "" "" "" "" ""
 "STA2" "n" "" "" "" "" "" ""
 "STA3" "n" "" "" "" "" "" ""
 "STA4" "n" "" "" "" "" "" ""
 "STA5" "n" "" "" "" "" "" ""
 "STA6" "n" "" "" "" "" "" ""

Any help would be greatly appreciated.

Thanks,

Shaun

Reply via email to