3

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?

4

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.