[pcre-dev] [Bug 2294] pcregrep -E

Góra strony
Delete this message
Autor: admin
Data:  
Dla: pcre-dev
Temat: [pcre-dev] [Bug 2294] pcregrep -E
https://bugs.exim.org/show_bug.cgi?id=2294

--- Comment #2 from Elliott Hughes <enh@???> ---
(In reply to Philip Hazel from comment #1)
> Not quite sure I follow you here: in pcre2grep -e is just a way of
> specifying a pattern to be matched. The pattern is always a Perl pattern.


ah, sorry, i just assumed it was EREs; i didn't check whether it was a
superset.

> That can't happen - the default must remain Perl regex as it always has
> been. So some other option is needed for BRE (possibly -G like GNU grep). I
> suppose, however, we could invent a compile-time option that sets what the
> default is, and add -P for completeness. Then it would be the default
> default that is -P.
> But I don't feel too comfortable doing that, because it would mean that
> "pcre2grep" would be different on different implementations. Perhaps a
> better plan is to implement -G, and then in Android you could make "grep" be
> an alias for "pcre2grep -G". We probably don't need #if __ANDROID__.


sadly you greatly underestimate the cost of starting an unnecessary new shell
on mobile devices :-(

this seemed acceptable for egrep and fgrep since they're deprecated anyway, and
you can (and should) just use grep.

how about checking argv[0]? if your concern is having bit-rotted code behind an
#if so only folks who deliberately call their pcre2grep binary "grep" get the
POSIX grep behavior. anyone who keeps it as pcre2grep keeps the pcre2grep
behavior.

--
You are receiving this mail because:
You are on the CC list for the bug.