Thursday, December 3, 2009

Re: Regular expression bug?

Ben Fritz schrieb:
>
> On Dec 3, 2:29 pm, Ben Fritz <fritzophre...@gmail.com> wrote:
>> It does look like a bug, unless someone knows a strange feature of the
>> \@<= zero-width match that prevents it from acting as expected.
>
> Nevermind, not a bug, I found the "strange feature" myself.
>
> Near the bottom of :help /\@<= you can see this:
>
> The part of the pattern after "\@<=" and "\@<!" are checked for a
> match first, thus things like "\1" don't work to reference \(\)
> inside
> the preceding atom.
>
> In other words, since "producer" is matched BEFORE the stuff preceding
> the \@<=, \1 contains nothing (a null string?) at this point in time
> and therefore your match won't work.

Conclusion:
/\%(^\1.\{39}\)\@<=\(\l[a-z0-9_]\{7}\)

--
Andy

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: