Tuesday, October 2, 2012

Re: Problem with a regular expression in Vim

/==\zs\%(aaa\|ddd\)\ze==/ works
~Adam~


On Tue, Oct 2, 2012 at 9:37 PM, Xell Liu <xell.liu@gmail.com> wrote:
Hi all,

Suppose this text fragment:

xxx==aaa==bbbccc==ddd==yyy

How can I match the "aaa" and "ddd" between the pair of "==" without
matching the bbbccc (or, of course, "xxx" or "yyy")?  Apparently
/==\zs[^=]\{-}\ze==/ fails.  However /==[^=]\{-}==/ does match the
"aaa" and "ddd" WITH the pair of "==".  I got lost here.

Thanks very much!

Cheers,
Xell

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

No comments:

Post a Comment