Dominique Pelle wrote:
> With the old engine, regexp \(\)\{2} does not match
> and give E486: Pattern not found: \(\)\{2}
>
> $ vim -c 'set hls re=1' \
> -c 'call feedkeys("iaaa\<Esc>/\\(\\)\\{2}\<CR>")'
>
> With the new engine, the same regexp matches
> the entire line (which becomes highlighted):
>
> $ vim -u NONE -c 'set hls re=2' \
> -c 'call feedkeys("iaaa\<Esc>/\\(\\)\\{2}\<CR>")'
>
> Regexp \(\)\{2} with nothing inside grouping
> parenthesis does not seem to make sense.
> Shouldn't it return an error instead?
I think so. However, it's difficult to decide for border cases, where
there is an empty match inside the parenthesis. This applies to
anything that repeats, * \+ and \{}. It seems the old engine is
inconsistent, sometimes it matches everything, sometimes nothing.
Strictly speaking, matching nothing or an empty match can repeated any
time and still match.
> Furthermore, the regexp \(\)\{80000} crashes
> with a stack overflow when using the new regexp
> only:
>
> $ vim -c 'set hls re=2' \
> -c 'call feedkeys("/\\(\\)\\{80000}\<CR>")'
> Segmentation fault (core dumped)
>
> I'm using vim-7.4.622 on Linux x86_64.
That needs to be fixed.
--
What is the difference between a professional and an amateur?
The ark was built by an amateur; professionals gave us the Titanic.
/// 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/d/optout.