I am getting the hang of grep
and regex, but I am confused about the different options.
grep --help | grep -i "reg.*ex"
-E, --extended-regexp PATTERN is an extended regular expression (ERE)
-G, --basic-regexp PATTERN is a basic regular expression (BRE)
-P, --perl-regexp PATTERN is a Perl regular expression
I have a general knowledge of regular expressions, but often I find myself stumbling on the basics (e.g. Using '*' when it actually requires '.*'), which I blame on not knowing the differences between the types of regular expressions (ERE, BRE, Perl regex).
Is it explained somewhere in detail?
perlre
andre_format
manuals on your system. See also the "see also" section of yourgrep
manual. Do come back with specific question about any of these type of expressions though. – Kusalananda Feb 28 '18 at 08:06