Friday, July 19, 2013

Vim's regex engine. [Was: regex variable]

On 18.07.13 21:34, shawn wilson wrote:
> This is probably a feature request but I really do hate the regex engine
> and would love to swap it out. Is there / can there be a compile time
> option to use a different engine?

Granted, vim's obscurely parochial regex engine has for many years been
the one great failing in an otherwise stunningly good utility. But now
it has the \v regex prefix to provide a very good simulation of posix
EREs, qualifying that mode as "modern regex"¹.

It does seem ludicrous to be afflicted by a different regex dialect in
each tool one uses, especially when awk, mutt, egrep (or grep -E), sed
-r, vim with the \v prefix, lex (OK, it also has extensions), and other
*nix tools _all_ use modern posix EREs, allowing users to move
seamlessly between them, without incurring a brain hernia. EREs also
don't suffer from the backslash storm which afflicts obsolete REs.

Is there anything additional about vim's regex engine which troubles you?

Does the new regex engine not address any of those concerns?
(I freely admit to not having tried it myself yet, so cannot say what
benefits it might have brought.)

Incidentally, a number of years ago, I compiled vim with another regex
suite, and the resulting EREs worked beautifully - except that vim's
help broke. In retrospect, I guess that new helptags might have fixed
that. In any event, roll-your-own-regex-suite didn't take long, AFAIR,
comprising mainly some wrapper functions to handle the slightly
different function interface.

Erik

¹ See `man 7 regex`

--
"I am sorry for the length of this letter, but I did not have the time
to write a short one"
- Blaise Pascal (in 1657), and later, Mark Twain.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: