]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bsdgrep: disable GNU_GREP_COMPAT by default
authoremaste <emaste@FreeBSD.org>
Fri, 21 Apr 2017 14:50:29 +0000 (14:50 +0000)
committeremaste <emaste@FreeBSD.org>
Fri, 21 Apr 2017 14:50:29 +0000 (14:50 +0000)
commitaf85d5feea49b666c20c9b10ce3df0fdbabb03be
tree85713b54e196244a146d368c37e9ce0f52f340d5
parentdd5e4bc8ddca0c889943e5b14e6278f819ebcde0
bsdgrep: disable GNU_GREP_COMPAT by default

The GNU extension bits in the base system are old, no longer faithful
to upstream, and surprising in some regards. Switch to documenting
WITH_GNU_GREP_COMPAT and default GNU_GREP_COMPAT to OFF in the name of
good behavior.

According to http://www.regular-expressions.info, GNU extensions:

-  Add missing quantifiers to BREs: \?, \+

-  Add branching to BREs: \|

-  Add backreferences (\1 through \9) to EREs

-  Add \w, \W, \s, and \S corresponding to :alnum:, [^[:alnum:]],
   :space:, and [^[:space:]] respectively

-  Add word boundaries and anchors:
   \b: word boundary
   \B: not word boundary
   \<: Strt of word
   \>: End of word
   \`: Start of subject string
    \': End of subject string

These extensions are still available in /usr/bin/grep by default today,
as it is still GNU grep.  As part of the bsdgrep migration plan these
extensions may be added to bsdgrep's regex support if necessary.

Submitted by: Kyle Evans <kevans91 at ksu.edu>
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D10114
share/man/man5/src.conf.5
share/mk/src.opts.mk
tools/build/options/WITH_GNU_GREP_COMPAT [new file with mode: 0644]