Ravi Sir's Cards › AWS
grep vs grep -E
This comparison card contrasts grep and grep -E. grep is described as basic regex. grep -E is described as extended regex. The card pairs grep with simple words, and grep -E with patterns with OR.
Read card text
What this card says
Regex type
grep
Basic regex.
grep -E
Extended regex.
Key points
+ ? and OR need backslashes.
+ ? OR and {n} work directly.
Example
grep 'cat\(s\)\?' f
Use when
Simple words.
Patterns with OR.