[HN Gopher] Confusing Grep Mistakes I've Made
       ___________________________________________________________________
        
       Confusing Grep Mistakes I've Made
        
       Author : r4um
       Score  : 31 points
       Date   : 2020-11-05 06:26 UTC (16 hours ago)
        
 (HTM) web link (blog.robertelder.org)
 (TXT) w3m dump (blog.robertelder.org)
        
       | gnagatomo wrote:
       | Most of the mistakes are not exclusive/related to grep, they are
       | actually shell mistakes.
        
         | Jenz wrote:
         | And simply regex mistakes.
        
       | m000 wrote:
       | Better title: grep newbie mistakes
        
         | chrisshroba wrote:
         | For some of the mistakes (like .* vs '.*') maybe, but I doubt
         | even experienced grep users are aware of all these things (e.g.
         | how \t is interpreted in BRE vs. extended vs. PCRE modes).
        
       | MaxBarraclough wrote:
       | Tripping over the escaping rules is a continuing pain. GNU sed
       | does things differently, using _\|_ for the regex _or_ operator.
       | [0] It 's fiddly enough to baffle the occasional StackOverflow
       | answerer. [1]
       | 
       | [0] https://www.gnu.org/software/sed/manual/sed.html#BRE-syntax
       | 
       | [1] https://stackoverflow.com/a/6388042/
        
       | bowmessage wrote:
       | Often my biggest mistake is using grep instead of rg.
        
       | sillysaurusx wrote:
       | Just use egrep instead of grep. Much easier to remember / less
       | surprising behavior, and it's supported on every system out of
       | the box (unlike rg).
        
       | [deleted]
        
       | [deleted]
        
       ___________________________________________________________________
       (page generated 2020-11-05 23:00 UTC)