thanks. yes I know we can use that way(/1 /2 ..etc).
what I meant is, how to use these to actually do the compare in a vim ex command line?
sth like :
:g#\(abc\d\+) bla bla \(abc\d\+\)#if /1 != /2 then echo "found a diff !"
of course this doesn't work but just some fake code to clarify what I meant
On Sat, Aug 10, 2013 at 3:30 AM, Marcin Szamotulski <mszamot@gmail.com> wrote:
Hi,
I am not sure if I understand you correctly but you can use \(...\) and
and then reuse it with \1 (it matches the same string as what \(...\)
have matched).
Regards,
Marcin
> --
On 00:44 Sat 10 Aug , ping song wrote:
> hi guys:
> I run into a scenario that , I need to compare 2 part of the regex string
> in one line :
>
> "abc123456 bla bla bla abc1234"
>
> so I'm thinking, can we use the backreference, to compare the first abc\d\+
> with the second one and only print out a message in case we detect the
> different ones ? preferably if this can be done with one command...
>
> thanks!
>
> --
> 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@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
--
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@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment