Chapter 4. Regular expressions

Table of Contents

1. Regular expressions
1.1. What are regular expressions?
1.2. Regular expression metacharacters
1.3. Basic versus extended regular expressions
2. Examples using grep
2.1. What is grep?
2.2. Grep and regular expressions
3. Pattern matching using Bash features
3.1. Character ranges
3.2. Character classes
4. Summary
5. Exercises

Abstract

In this chapter we discuss:

  • Using regular expressions

  • Regular expression metacharacters

  • Finding patterns in files or output

  • Character ranges and classes in Bash