I understand that GNU grep
without -E
uses basic regex and that grep -E
uses extended regex. Is there any harm in using grep -E
even for situations that would work with plain grep
?
1 Answer
Not much. Back referencing is not possible in grep -E, so you cannot match the same text as previously matched by a (..)
capturing group (though some grep
implementations like GNU and BSD grep
allow it as a non-standard extension).
And if you want to match literal braces or parentheses,?
,+
, you now will need to escape them...