Defining ERE patterns

We saw how easy it is to define BRE patterns. Now, we will see some ERE patterns, which are more powerful.

ERE engines understand the following patterns besides BRE patterns:

  • Question marks
  • Plus signs
  • Curly braces
  • Pipe characters
  • Expression grouping

By default, AWK supports ERE patterns, and sed needs -r to understand these patterns.

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.