Re: Help me please ^^

2011-05-03 Thread HaoCheng Zhao
Thanks guys ^_^

So, shall we get the conclusion that:
What sed does is correct according to POSIX, and VIM or PERL or some others
still need a bit improve on handling zero-length matches?

On Wed, May 4, 2011 at 7:03 AM, Ben Schmidt
wrote:

> perl returns '1a11c1', BTW!
>>
>
> Mmm. It's a bit debatable whether the second 1 in the 11 represents an
> overlapping match or not. That's the problem with zero-length matches
> that aren't solidly anchored; there are a lot of funny edge cases.
>
> Ben.
>
>
> --
> 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 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


Help me please ^^

2011-05-02 Thread HaoCheng Zhao
If I use these command in bash shell:
echo 'abc' | sed 's/b*/1/g'
It would display:
1a1c1


But when I try it in VIM:
(open a document, turn into edit mode and simply type 'abc', and then
turn into command mode)
:s/b*/1/g
it would display:
1a1c

I'm wondering why I get different results(no 1 at the tail when using VIM)
through the same way (basic regular expression)...
I think /b*/ would match the null string between 'c' and '$', and a
substitution would be taken (just like what 'sed' done above).

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