home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] does current gnu grep support EREs out of the box?

  • Subject: Re: [OCLUG-Tech] does current gnu grep support EREs out of the box?
  • From: Richard Guy Briggs <rgb [ at ] tricolour [ dot ] ca>
  • Date: Tue, 6 Mar 2018 06:10:06 -0500
On 2018-03-06 05:35, Robert P. J. Day wrote:
> 
>   course i taught last week provided courseware that distinguished
> between grep's basic RE support and "extended" RE support, which
> surprised me as, on my fedora 27 system, the man page for grep has the
> following snippets:
> 
> "In addition, the variant programs egrep and fgrep are the same as
> grep -E and grep -F, respectively.  These variants are deprecated, but
> are provided for backward compatibility."
> 
>   also, further down:
> 
> "grep understands three different versions of regular expression
> syntax: ???basic??? (BRE), ???extended??? (ERE) and ???perl??? (PCRE).  In GNU
> grep there is no difference in available functionality between basic
> and extended syntaxes."
> 
>   that *seems* pretty clear, but i just want to confirm that, in gnu
> grep these days, the extended REs are now available automatically and
> don't require options like they used to. thoughts?

I don't remember which system this was on, but was a bit surprised at one point
when I was using extended regex syntax with grep without the -E flag and it
just worked.  In the past I had to invoke the flag to get that functionality.
I don't remember the details of which distro it was or what extended syntax
feature I was using.

> rday

	slainte mhath, RGB

--
Richard Guy Briggs               --  ~\    -- ~\             <hpv.tricolour.ca>
<www.TriColour.ca>                 --  \___   o \@      @        Ride yer bike!
Ottawa, ON, CANADA                  --  Lo_>__M__\\/\%__\\/\%
Vote! -- <greenparty.ca>_____GTVS6#790__(*)__(*)________(*)(*)_________________