On Thu, May 05, 2011 at 10:49:23PM +0200, Tony Mechelynck wrote:
> I don't really know any other regular expressions than Vim's, because
> those are exhaustively documented, in a set of cross-linked helpfiles
> which I constantly have at my fingertips.

A ":helpgrep regex" has just now shown me more regex info than I had
known was there. Now that I know it exists, I'll have to spend some more
time with it.

> Sometimes I use regular expressions in less or egrep, and in that
> case I try (not too complicated) Vim patterns in the hope that they
> will be recognized: they often are, and when they aren't, well, let's
> try something else then.

I've been slow to realise that Vim users don't necessarily use a variety
of posix compliant applications, and so haven't experienced the great
productivity benefit of being able to move between them _without_ trial
and error, or resort to documentation.

> If I were to regularly use some program with a different regexp
> dialect, I'd try to find the appropriate documentation, because
> trial-and-error may be OK for occasional use, it won't do for serious
> systematic programming.

Though I haven't found any reference in the help, on the posix-ness of
Vim's several regex options, default magic seems close to posix BRE
(Perhaps plus some goodies. I haven't checked at all thoroughly.)
And \v magic seems close to posix ERE, plus some extra goodies, such as
non-greedy matches.

When forgetting to prepend \v to every Vim regex, I'll just have to
hope that the outcome is obviously wrong, not just invisibly so.
(A "set command_line_regex_default = \v" wouldn't impact on script
portability, but might be awkward to implement, perhaps.)

Erik

-- 
Unix is the IDE. Vim is the editor. (Vale Vi)

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

Reply via email to