On Wednesday, June 19, 2013 11:19:44 PM UTC-5, kien wrote:
> On Thursday, June 20, 2013 11:06:20 AM UTC+7, Ben Fritz wrote:
> > If I escape the & characters as \&, this is exactly what I get.
> 
> You didn't, and still doesn't need to escape & if using `\v(&&|str)` or 
> `\v&`. It's just the `\v(str|&&)` that causes the error. That's the problem. 
> I thought I had made this clear enough in the first email.

I understand you get an error for the str|&& pattern. I agree you should not 
get an error. I can duplicate the error.

Aside from the error, I was trying to helpfully point out that \v with && in 
the pattern will NOT match a literal && string, which I assume is the intent of 
the pattern.

If you actually want a pattern that matches everywhere, then that's up to you. 
But somehow I don't think this is really what you want.

And yes, I tested. \v(&&|str) matches everywhere in any text, regardless of the 
regexpengine setting.

You absolutely need to escape a & character if you use \v in a pattern, and 
expect to match a literal '&' character. Otherwise it acts as a "branch" as 
detailed at :help /\&. If you do NOT use \v in the pattern, then && will in 
fact match a literal "&&" string.

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui