Re: Skipping arbitrary text in syntax regions
- Doug Kearns <djkea2@...> writes:
> On Fri, Aug 22, 2003 at 09:55:55AM -0700, Keith Roberts wrote:Try looking at the help for the \@<= pattern. I think the following
>> "start" can be a pattern, so wouldn't this work?
>> :syn region MyString matchgroup="MyDelimiter"
>> start="begin\ze.*$" end="finish"
> Thanks, but this includes the trailing " not special text" as part of
> the MyString syntax group. I need this to be excluded entirely from the
> region. Let's say that "not special text" matches as the MyNotSpecial
> syntax group. I can't have MyString contain MyNotSpecial because "not
> special text" shouldn't match where "special text" is located - in the
> region 'body'.
> So, the question might have been more clearly put as: Is there some way
> to exclude the "not special text" string after, and on the same line as,
> begin from the region entirely, so it does not match as part of the
> MyString or MyDelimiter syntax groups?
does what you are after...
syn region MyString start="\(begin.*\)\@<=$" end="finish"
This signature intentionally left blank