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

/^\[\w"]

Expand Messages
  • tom arnall
    with nomagic /^ [ w ] does not get every match. it skips random intervals of matching lines with every try. que pasa? -- -- You received this message
    Message 1 of 7 , Sep 17, 2013
    • 0 Attachment
      with nomagic /^\[\w"] does not get every match. it skips random
      intervals of matching lines with every try. que pasa?

      --
      --
      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.
    • Christian Brabandt
      ... If I see this correctly, this matches all lines starting with either an , an w or (quote) and nothing else. I suspect, you have an error in your
      Message 2 of 7 , Sep 17, 2013
      • 0 Attachment
        On Wed, September 18, 2013 06:56, tom arnall wrote:
        > with nomagic /^\[\w"] does not get every match. it skips random
        > intervals of matching lines with every try. que pasa?

        If I see this correctly, this matches all lines starting with either
        an '\', an 'w' or '"' (quote) and nothing else.
        I suspect, you have an error in your regexp. What are you trying to match
        here?

        regards,
        Christian

        --
        --
        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.
      • Gary Johnson
        ... For example, .... Regards, Gary -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
        Message 3 of 7 , Sep 17, 2013
        • 0 Attachment
          On 2013-09-17, tom arnall wrote:
          > with nomagic /^\[\w"] does not get every match. it skips random
          > intervals of matching lines with every try. que pasa?

          For example, ....

          Regards,
          Gary

          --
          --
          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.
        • tom arnall
          ... In the process of getting an example, I found that vim is skipping to lines starting with w . What do I say in nomagic that gets all letter chars and
          Message 4 of 7 , Sep 18, 2013
          • 0 Attachment
            On 9/17/13, Gary Johnson <garyjohn@...> wrote:
            > On 2013-09-17, tom arnall wrote:
            >> with nomagic /^\[\w"] does not get every match. it skips random
            >> intervals of matching lines with every try. que pasa?
            >
            > For example, ....
            >
            > Regards,
            > Gary
            >

            In the process of getting an example, I found that vim is skipping to
            lines starting with 'w'. What do I say in nomagic that gets all letter
            chars and number chars and double quote?


            > --
            > --
            > 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.
            >


            --
            Regards,

            Tom Arnall
            Ensenada, Baja California


            ----------------
            "The basic truths are self-evident, but 'self-evident' does not mean
            'obvious'." Spinoza, approx.

            --
            --
            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.
          • Christian Brabandt
            ... Yes, because that is what you told you RE to do. [ w ] Means match either or w or . If you want to have all letters and numbers and double quotes,
            Message 5 of 7 , Sep 18, 2013
            • 0 Attachment
              On Thu, September 19, 2013 07:10, tom arnall wrote:
              > On 9/17/13, Gary Johnson <garyjohn@...> wrote:
              >> On 2013-09-17, tom arnall wrote:
              >>> with nomagic /^\[\w"] does not get every match. it skips random
              >>> intervals of matching lines with every try. que pasa?
              >>
              >> For example, ....
              >
              > In the process of getting an example, I found that vim is skipping to
              > lines starting with 'w'. What do I say in nomagic that gets all letter
              > chars and number chars and double quote?

              Yes, because that is what you told you RE to do. [\w"] Means match either
              '\' or 'w' or '"'. If you want to have all letters and numbers and
              double quotes, try explicitly [a-zA-Z0-9"]

              regards,
              Christian


              --
              --
              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.
            • Erik Christiansen
              ... Standardising on one flavour across tools helps avoid such confusion, and the Posix ERE convention is widely used amongst text tools. In vim I d then use
              Message 6 of 7 , Sep 18, 2013
              • 0 Attachment
                On 18.09.13 22:10, tom arnall wrote:
                > On 9/17/13, Gary Johnson <garyjohn@...> wrote:
                > > On 2013-09-17, tom arnall wrote:
                > >> with nomagic /^\[\w"] does not get every match. it skips random
                > >> intervals of matching lines with every try. que pasa?
                ...
                > In the process of getting an example, I found that vim is skipping to
                > lines starting with 'w'. What do I say in nomagic that gets all letter
                > chars and number chars and double quote?

                Standardising on one flavour across tools helps avoid such confusion,
                and the Posix ERE convention is widely used amongst text tools. In vim
                I'd then use either:

                /\v[A-za-z0-9"]

                or

                /\v(\a|\d|") # OK, that uses extensions, but consistent grammar.

                If it's necessary to use BREs ("nomagic"), in order to win a bet, then
                just take out the \v and add the obfuscating backslashes which make BREs
                such a pain, e.g.:

                /\(\a\|\d\|"\)

                Erik

                --
                Tecoma's Macca's-striking flash mob: " http://www.youtube.com/watch?v=H7-0T1vbnWE
                Stop fat food joint opposite Tecoma preschool: www.change.org
                Taking democracy (98,000 signatures) from Australia to Chicago:
                http://www.abc.net.au/news/2013-09-17/tecoma-residents-take-fight-against-mcdonalds-to-chicago/4963866

                --
                --
                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.
              • Gary Johnson
                ... To elaborate a bit, you can t use backslash-escaped character classes within a collection, i.e., between [ and ]. You can, however, use named character
                Message 7 of 7 , Sep 18, 2013
                • 0 Attachment
                  On 2013-09-19, Christian Brabandt wrote:
                  > On Thu, September 19, 2013 07:10, tom arnall wrote:
                  > > On 9/17/13, Gary Johnson wrote:
                  > >> On 2013-09-17, tom arnall wrote:
                  > >>> with nomagic /^\[\w"] does not get every match. it skips random
                  > >>> intervals of matching lines with every try. que pasa?
                  > >>
                  > >> For example, ....
                  > >
                  > > In the process of getting an example, I found that vim is skipping to
                  > > lines starting with 'w'. What do I say in nomagic that gets all letter
                  > > chars and number chars and double quote?
                  >
                  > Yes, because that is what you told you RE to do. [\w"] Means match either
                  > '\' or 'w' or '"'. If you want to have all letters and numbers and
                  > double quotes, try explicitly [a-zA-Z0-9"]

                  To elaborate a bit, you can't use backslash-escaped character
                  classes within a collection, i.e., between [ and ].

                  You can, however, use named character classes such as [:alnum:], so
                  this pattern would also work:

                  ^\[[:alnum:]"]

                  Regards,
                  Gary

                  --
                  --
                  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.