Thursday, April 14, 2016

Re: RFE: support POSIX standard and developing RE's

On 15 April 2016, Erik Christiansen <dvalin@internode.on.net> wrote:
> On 14.04.16 14:40, Christian Brabandt wrote:
> > Am 2016-04-14 12:14, schrieb Erik Christiansen:
> > >So many unix utilities support POSIX "Modern" EREs, that it is the
> > >best standard to conform to. There's then only one regex dialect to
> > >learn. (Queue horn fanfare and singing angels)
> >
> > And that is an argument for what, considering that vi comes from a
> > time, where BRE where the default RE dialect?
>
> Consistent regexes across unix utilities. Perhaps I was not
> sufficiently explicit in that regard? I note the deep attachment to
> obsolete BREs expressed above, but the rest of the world has moved on
> to modern EREs.
>
> O'Reilly's "Mastering Regular Expressions" mentions that "POSIX
> standardized the workings of over 70 programs, including traditional
> regex-wielding tools such as awk, ed, egrep, expr, grep, and sed."
> (And mutt, lex, ...)
[...]

"Consistent regexes across unix utilities"? You sir are either a
troll, or simply have no idea what you're talking about.

Take a look here:

https://en.wikipedia.org/wiki/Comparison_of_regular_expression_engines

So why ERE instead of PCRE? Oniguruma? RE2?

Actually, try something simpler:

$ grep --version
grep (GNU grep) 2.24
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

$ echo 'foo bar' | egrep -o '[[:<:]]bar'
grep: Invalid character class name

That's because GNU grep has its own \< and \> instead of POSIX
[[:<:]] and [[:>:]]. Have you considered starting a crusade to convince
GNU people to adhere to POSIX conventions, in the name of consistenty?

As for Vim: its regexes have features not present in any other
language. People use them, and thousands of plugins and syntax files
rely on them. You're asking to break all of them because you _prefer_
something else? Wake up please. It would have been nice if Vim regexes
had a nicer syntax. It's some 20 years too late to change them now.

/lcd

--
--
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/d/optout.

No comments:

Post a Comment