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

Regular expression bug?

Expand Messages
  • Nikolai Weibull
    OK, been trying to get this to work: syn region rubyString matchgroup=rubyStringDelimit start=+ (class s* ) @
    Message 1 of 6 , Jul 30, 2003
    • 0 Attachment
      OK, been trying to get this to work:
      syn region rubyString matchgroup=rubyStringDelimit
      \start=+\(class\s*\)\@<!<<-'\z(.*\)'.*\zs$+ end=+^\s*\z1$+ fold

      But this does not work. In fact, it seems one cannot have a
      word-character in front of \zs. Why is this so?
      ex.:
      syn match rubyString +<<-'EOL'\zs.*$+
      does not match
      INTERP._invoke("proc", "rb_out", "args", <<-'EOL')
      this, however, does
      syn match rubyString +<<-'\zs.*$+
      am i missing something vital here?
      nikolai


      --
      ::: name: Nikolai Weibull :: aliases: pcp / lone-star :::
      ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
      ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 :::
      main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
    • Nikolai Weibull
      ... don t want to be a bitch, but does anyone know anything about this? It s actually for a worthy cause. It would allow the Ruby construct method(arg1,
      Message 2 of 6 , Aug 1, 2003
      • 0 Attachment
        * Nikolai Weibull <lone-star@...> [Jul, 31 2003 01:00]:
        > OK, been trying to get this to work:
        > syn region rubyString matchgroup=rubyStringDelimit
        > \start=+\(class\s*\)\@<!<<-'\z(.*\)'.*\zs$+ end=+^\s*\z1$+ fold
        >
        > But this does not work. In fact, it seems one cannot have a
        > word-character in front of \zs. Why is this so?
        > ex.:
        > syn match rubyString +<<-'EOL'\zs.*$+
        > does not match
        > INTERP._invoke("proc", "rb_out", "args", <<-'EOL')
        > this, however, does
        > syn match rubyString +<<-'\zs.*$+
        > am i missing something vital here?
        > nikolai
        >
        don't want to be a bitch, but does anyone know anything about this?
        It's actually for a worthy cause. It would allow the Ruby construct
        method(arg1, <<-EOF, arg2, ...)
        text
        EOF
        to actually be highlighted correctly. Or if anyone could suggest a
        better way of telling the match to begin on the next line, be my guest.
        nikolai

        --
        ::: name: Nikolai Weibull :: aliases: pcp / lone-star :::
        ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
        ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 :::
        main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
      • Mikolaj Machowski
        ... Trying with this: start=+ (class s* ) @
        Message 3 of 6 , Aug 1, 2003
        • 0 Attachment
          On Fri, Aug 01, 2003 at 08:38:54PM +0200, Nikolai Weibull wrote:
          > * Nikolai Weibull <lone-star@...> [Jul, 31 2003 01:00]:
          > > OK, been trying to get this to work:
          > > syn region rubyString matchgroup=rubyStringDelimit
          > > \start=+\(class\s*\)\@<!<<-'\z(.*\)'.*\zs$+ end=+^\s*\z1$+ fold
          > >
          > > But this does not work. In fact, it seems one cannot have a
          > > word-character in front of \zs. Why is this so?
          > > ex.:
          > > syn match rubyString +<<-'EOL'\zs.*$+
          > > does not match
          > > INTERP._invoke("proc", "rb_out", "args", <<-'EOL')
          > > this, however, does
          > > syn match rubyString +<<-'\zs.*$+
          > > am i missing something vital here?
          > > nikolai
          > >
          > don't want to be a bitch, but does anyone know anything about this?
          > It's actually for a worthy cause. It would allow the Ruby construct
          > method(arg1, <<-EOF, arg2, ...)
          > text
          > EOF
          > to actually be highlighted correctly. Or if anyone could suggest a
          > better way of telling the match to begin on the next line, be my guest.
          > nikolai
          Trying with this:
          \start=+\(class\s*\)\@<!<<-'\z(.*\)'.*\zs$+ end=+^\s*\z1$+ fold

          \start=+\(class\s*\)\@<!<<-'\z([^']*\)'.*\zs$+ end=+^\s*\z1$+ fold

          But I am not sure if you can use \z(\) and \zs in one expression at
          all.

          m.
          --
          LaTeX + Vim = http://vim-latex.sourceforge.net/
          Vim-list(s) Users Map: (last change 27 May)
          http://skawina.eu.org/mikolaj/vimlist
          Are You There?
        • Nikolai Weibull
          ... no, doesn t help...thanks for suggestion anyway. nikolai ... i can t see why they would be mutually exclusive, but yeah...maybe nikolai -- ...
          Message 4 of 6 , Aug 2, 2003
          • 0 Attachment
            * Mikolaj Machowski <mikmach@...> [Aug, 02 2003 13:20]:
            > Trying with this:
            > \start=+\(class\s*\)\@<!<<-'\z(.*\)'.*\zs$+ end=+^\s*\z1$+ fold
            >
            > \start=+\(class\s*\)\@<!<<-'\z([^']*\)'.*\zs$+ end=+^\s*\z1$+ fold
            >
            no, doesn't help...thanks for suggestion anyway.
            nikolai

            > But I am not sure if you can use \z(\) and \zs in one expression at
            > all.
            i can't see why they would be mutually exclusive, but yeah...maybe
            nikolai

            --
            ::: name: Nikolai Weibull :: aliases: pcp / lone-star :::
            ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
            ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 :::
            main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
          • Benji Fisher
            ... Can you ask this as a regular-expression question (using a search, for example) rather than as a syntax question? That is, can you give a search pattern
            Message 5 of 6 , Aug 7, 2003
            • 0 Attachment
              Nikolai Weibull wrote:
              > OK, been trying to get this to work:
              > syn region rubyString matchgroup=rubyStringDelimit
              > \start=+\(class\s*\)\@<!<<-'\z(.*\)'.*\zs$+ end=+^\s*\z1$+ fold
              >
              > But this does not work. In fact, it seems one cannot have a
              > word-character in front of \zs. Why is this so?
              > ex.:
              > syn match rubyString +<<-'EOL'\zs.*$+
              > does not match
              > INTERP._invoke("proc", "rb_out", "args", <<-'EOL')
              > this, however, does
              > syn match rubyString +<<-'\zs.*$+
              > am i missing something vital here?
              > nikolai

              Can you ask this as a regular-expression question (using a search,
              for example) rather than as a syntax question? That is, can you give a
              search pattern and a sample text that do not give the expected results?

              --Benji Fisher
            • Nikolai Weibull
              ... hm...no...the reason being that it works if you enter it as a search. nikolai -- ... main(){printf(&linux[ 021%six 012 0 ],(linux)[ have ]+ fun -97);}
              Message 6 of 6 , Aug 7, 2003
              • 0 Attachment
                * Benji Fisher <benji@...> [Aug, 07 2003 17:50]:
                >
                > Can you ask this as a regular-expression question (using a search,
                > for example) rather than as a syntax question? That is, can you give a
                > search pattern and a sample text that do not give the expected results?
                >
                hm...no...the reason being that it works if you enter it as a search.
                nikolai

                --
                ::: name: Nikolai Weibull :: aliases: pcp / lone-star :::
                ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
                ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 :::
                main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
              Your message has been successfully submitted and would be delivered to recipients shortly.