grep
grep searches files for patterns (described as regular expressions) and prints matching lines.
grep [option...] [patterns] [file...]
Generally, you should always enclose the regular expression in single quotes to avoid the interpretation and expansion of the meta-characters by the shell.
To ignore case when searching, use the -i option (or –ignore-case).
Regular Expressions
grep understands three different versions of regular expression syntax: basic (BRE), extended (ERE), and Perl-compatible (PCRE).
-G, –basic-regexp PATTERNS are basic regular expressions
This is the default.
As explained in Basic vs Extended Regular Expressions the key difference between basic and extended is special (or meta) characters have to be escaped (ie backslashed).
-E, –extended-regexp PATTERNS are extended regular expressions
Historically, this was called egrep.
-P, –perl-regexp PATTERNS are Perl regular expressions
Perl Compatible Regular Expressions
-F, –fixed-strings PATTERNS are strings
Historically, this was called fgrep.