Monday, September 17, 2012

Re: Why matchstr returns also text matched by zero-width pattern?

Hello!

First of all, thank you for your reply!

> I think you wanted one of these:
> \v(123)@<=abc

Yes, this is what I wanted.

> Additionally, if this WERE working as you expect, your pattern would NEVER
> match. You are saying,
> "match abc where 123 also matches in the same position"
> which cannot possibly succeed, because 123 does not match where abc matches.

I don't get this. Of course I didn't want to match 'abc' on '123'. (That's the purpose of regexes, match pattern where the pattern match, I would say...?) I posted simplified example, originally I wanted to match last word before the parenthesis, which is a function name. The '@<=' works fine for this.

Thank you for your help!

Martin Jiricka


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