Skip to main content
Post Closed as "Duplicate" by Kusalananda, CommunityBot, Jeff Schaller, Stephen Kitt, Romeo Ninov
Formatting.
Source Link
Stephen Kitt
  • 480.9k
  • 59
  • 1.2k
  • 1.4k

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 '' 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?

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?

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?

Source Link

Grep options for Regular Expressions. (ERE, BRE, Perl regex) differences

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?