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

regexp: different match, re=1 vs re=0

Expand Messages
  • William Fugh
    Version: 7.4, gVim, MS-DOS/MS-Windows ... the command line as above, one line for test as follows, means a space. ...
    Message 1 of 4 , Aug 21, 2013
    • 0 Attachment
      Version: 7.4, gVim, MS-DOS/MS-Windows
      =========================================================
      :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\|\s\+\ze[)}]\|\s\zs\s\+\|\s\+\ze[,;.]\([^.,;]\)##g
      ----------------------------------------------------------------------------------------------------------------
      the command line as above, one line for test as follows, <Space> means a space.
      -----------------------------------------------------------------------------------------------------------------
      This<Space>is<Space><Space><Space>[a<Space>test.
      =========================================================
      Result of re=1: This<Space>is<Space>[a<Space>test.
      Result of re=0: This<Space>is<Space><Space>test.
      ==============================================================
      Both of these regexp engines have the same result if the following command line is used:-)

      ---------------------------------------------------------------------------------------------------------------------------
      :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\ze\|\zs\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\ze\|\zs\s\+\ze[)}]\|\s\zs\s\+\ze\|\zs\s\+\ze[,;.]\([^.,;]\)##g
      ---------------------------------------------------------------------------------------------------------------------------

      Thanks
      -William

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
       
      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Dominique Pellé
      ... Just to confirm that I can reproduce the bug with Vim-7.4.5 on Linux. Regards Dominique -- -- You received this message from the vim_use maillist. Do not
      Message 2 of 4 , Aug 21, 2013
      • 0 Attachment
        William Fugh wrote:

        > Version: 7.4, gVim, MS-DOS/MS-Windows
        > =========================================================
        > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\|\s\+\ze[)}]\|\s\zs\s\+\|\s\+\ze[,;.]\([^.,;]\)##g
        > ----------------------------------------------------------------------------------------------------------------
        > the command line as above, one line for test as follows, <Space> means a
        > space.
        > -----------------------------------------------------------------------------------------------------------------
        > This<Space>is<Space><Space><Space>[a<Space>test.
        > =========================================================
        > Result of re=1: This<Space>is<Space>[a<Space>test.
        > Result of re=0: This<Space>is<Space><Space>test.


        Just to confirm that I can reproduce the bug with Vim-7.4.5 on Linux.

        Regards
        Dominique

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Bram Moolenaar
        ... That s a long regexp. Can you reproduce it with a (much) shorter one? -- hundred-and-one symptoms of being an internet addict: 103. When you find yourself
        Message 3 of 4 , Aug 22, 2013
        • 0 Attachment
          William Fugh wrote:

          > Version: 7.4, gVim, MS-DOS/MS-Windows
          > =========================================================
          > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\|\s\+\ze[)}]\|\s\zs\s\+\|\s\+\ze[,;.]\([^.,;]\)##g
          > ----------------------------------------------------------------------------------------------------------------
          > the command line as above, one line for test as follows, <Space> means a
          > space.
          > -----------------------------------------------------------------------------------------------------------------
          > This<Space>is<Space><Space><Space>[a<Space>test.
          > =========================================================
          > Result of re=1: This<Space>is<Space>[a<Space>test.
          > Result of re=0: This<Space>is<Space><Space>test.
          > ==============================================================*
          > Both of these regexp engines have the same result if the following command
          > line is used:-)*
          > ---------------------------------------------------------------------------------------------------------------------------
          > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\ze\|\zs\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\ze\|\zs\s\+\ze[)}]\|\s\zs\s\+\ze\|\zs\s\+\ze[,;.]\([^.,;]\)##g
          > ---------------------------------------------------------------------------------------------------------------------------

          That's a long regexp. Can you reproduce it with a (much) shorter one?

          --
          hundred-and-one symptoms of being an internet addict:
          103. When you find yourself in the "Computer" section of Barnes & Noble
          enjoying yourself.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ an exciting new programming language -- http://www.Zimbu.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • William Fugh
          ... Regards -William ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For
          Message 4 of 4 , Aug 23, 2013
          • 0 Attachment



            On Thu, Aug 22, 2013 at 10:14 PM, Bram Moolenaar <Bram@...> wrote:

            William Fugh wrote:

            > Version: 7.4, gVim, MS-DOS/MS-Windows
            > =========================================================
            > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\|\s\+\ze[)}]\|\s\zs\s\+\|\s\+\ze[,;.]\([^.,;]\)##g
            > ----------------------------------------------------------------------------------------------------------------
            > the command line as above, one line for test as follows, <Space> means a
            > space.
            > -----------------------------------------------------------------------------------------------------------------
            > This<Space>is<Space><Space><Space>[a<Space>test.
            > =========================================================
            > Result of re=1: This<Space>is<Space>[a<Space>test.
            > Result of re=0: This<Space>is<Space><Space>test.
            > ==============================================================*
            > Both of these regexp engines have the same result if the following command
            > line is used:-)*
            > ---------------------------------------------------------------------------------------------------------------------------
            > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\ze\|\zs\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\ze\|\zs\s\+\ze[)}]\|\s\zs\s\+\ze\|\zs\s\+\ze[,;.]\([^.,;]\)##g
            > ---------------------------------------------------------------------------------------------------------------------------

            That's a long regexp.  Can you reproduce it with a (much) shorter one?
             
            :%s#\s\+\ze\[/\|\s\zs\s\+##g          "result: (re=1) <> (re=0
            :%s#\s\+\ze\[/\|\s\zs\s\+\ze##g      "result: (re=1) == (re=0

            Regards
            -William


            On Thu, Aug 22, 2013 at 10:14 PM, Bram Moolenaar <Bram@...> wrote:

            William Fugh wrote:

            > Version: 7.4, gVim, MS-DOS/MS-Windows
            > =========================================================
            > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\|\s\+\ze[)}]\|\s\zs\s\+\|\s\+\ze[,;.]\([^.,;]\)##g
            > ----------------------------------------------------------------------------------------------------------------
            > the command line as above, one line for test as follows, <Space> means a
            > space.
            > -----------------------------------------------------------------------------------------------------------------
            > This<Space>is<Space><Space><Space>[a<Space>test.
            > =========================================================
            > Result of re=1: This<Space>is<Space>[a<Space>test.
            > Result of re=0: This<Space>is<Space><Space>test.
            > ==============================================================*
            > Both of these regexp engines have the same result if the following command
            > line is used:-)*
            > ---------------------------------------------------------------------------------------------------------------------------
            > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\ze\|\zs\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\ze\|\zs\s\+\ze[)}]\|\s\zs\s\+\ze\|\zs\s\+\ze[,;.]\([^.,;]\)##g
            > ---------------------------------------------------------------------------------------------------------------------------

            That's a long regexp.  Can you reproduce it with a (much) shorter one?

            --
            hundred-and-one symptoms of being an internet addict:
            103. When you find yourself in the "Computer" section of Barnes & Noble
                 enjoying yourself.

             /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
            ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\  an exciting new programming language -- http://www.Zimbu.org        ///
             \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
             
            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          Your message has been successfully submitted and would be delivered to recipients shortly.