On Wed, May 10, 2006 at 02:53:20PM -0600, Shaun Cummins wrote:
> 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

     I do not think I can answer this, and there may not be a way to do
what you want, but I want to clarify the question.  Is your intention to
match the "STALIST 6" with the start pattern and, since it ends in " 6",
match the next 6 lines with the end pattern?

     BTW, do you realize that in your end pattern, ".\+" will match all
of
        "STA1" "n" "" "" "" "" "" ""
and .* will then match nothing?

HTH                                     --Benji Fisher

Reply via email to