Urtica Dioica (Gaultheria Shallon?) wrote:
> The regex in question became somewhat famous after the VimCast at
> http://vimcasts.org/episodes/vimgolf-prime-numbers/
>
> Here's the setup:
>
> C<Tab>1<Esc>qq<C-A>>>Ypq540@q
>
> From here, the following command is used to remove lines with a
> composite number ot tabs:
>
> :g/\v^(<Tab><Tab>+)\1+</d<CR>
>
> On Vim 7.4.91, this regex uses the NFA engine, and fails to match the
> correct number of tabs. When manually switching engines by prepending
> \%#=1 to the regex, it works correctly.
>
> By removing the < at the end of the regex, like this:
>
> \v^(\t\t+)\1+
>
> and searching with 'hlsearch' on, you can see how many tabs are
> matched. The old engine correctly matches the highest composite number
> of tabs possible in each line. The NFA engine matches a number of tabs
> equal to the highest number in: 4, 6, 10, 18, 34, 66, 130, 258, 514.
> What the pattern is, I don't know.
Power of 2 plus 2.
I guess the problem is with using \< at the end of the pattern.
--
Back off man, I'm a scientist.
-- Peter, Ghostbusters
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
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.