Sunday, February 2, 2014

Re: regular expression blindness

On 19:17 Sun 02 Feb , Erik Christiansen wrote:
> On 01.02.14 08:23, Tim Chase wrote:
> > 2) if you just want to search, you can use the more complex pattern
> >
> > /^\(\.\/\)\@!
>
> Yebbut, that's nearly 50% backslashes, so hard to read through the
> picket fence. In less obsolete syntax it is:
>
> /\v^(\.\/)@!
>
> I.e. only the literalised magic chars need be escaped. The picket fence
> of backslashes which do nothing useful is completely gone. :-)
>
> Now if Vim had a config option to preset "\v" (posix ERE), then we'd be
> in the 21st century at last.
>
> Erik

Since we are in 21st century ;), I just wrote a small plugin for that:
http://www.vim.org/scripts/script.php?script_id=4849

Cheers,
Marcin

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

Post a Comment