Loading ...
Sorry, an error occurred while loading the content.

65328Re: Two questions: Regex for multiple lines; Syntax highlighting

Expand Messages
  • Gary Holloway
    Feb 1, 2006
      I don't see that anyone answered this.
      I've got (presumably) the answer for #1; I don't see a solution for #2.

      I believe the problem you're having with #1 is that "\_." will include
      the newlines in the count.
      Try this instead:

      /<start>\n\?\(.\n\?\)\{-1640,}<end>/

      That seemed to do the trick when I played around with it.

      John Degen wrote:

      >1
      >I have a syntax file which should highlight text,
      >spanning multiple lines, if it exceeds 1640
      >characters, including white space between two tags
      >(like <begintag> and <endtag>).
      >These tags occur multiple times in the buffer, so I
      >tried putting this non-greedy regex in the syntax
      >file:
      >
      ><begintag>\_.\{-1640,}<endtag>
      >
      >but it matches the text up to and including the next
      ><endtag> if the number of characters is less than
      >1640.
      >
      >/<begintag>\_.\{-1640,}<endtag>
      >
      >*does* work well. What can this be?
      >
      >2
      >I would like the change in highlighting to occur as
      >soon as I type character # 1641, but currently I need
      >to do :redr! for the change to take effect.
      >
      >
      >
      >

      --
      Gary Holloway
      Manager of Applications Programming
      Cast & Crew Entertainment Services, Inc.
      858-565-1513 x104
    • Show all 2 messages in this topic