Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

Bash Patterns and Regular Expressions

via LinkedIn Learning

Overview

Discover how to quickly pull pieces of data from any text file. Learn the fundamentals of Bash regular expressions for the purpose of matching patterns.

Syllabus

Introduction
  • Use Bash to pull data in seconds
  • What you should know
1. Shell Globs
  • What are globs?
  • Shell expansion order
  • Wildcards
  • Character sets
  • The effect of locale on searches
  • Character classes
  • Shell globbing options
2. Shell Extended Globbing
  • What are extended globs?
  • Why you should use extended globs
  • Make extended globs persistent
  • Getting started with extended globs
  • Pattern matching with extended globs
  • Using extended globs with commands
  • Comparing extended globs with regular expressions
3. Shell Brace Expansion
  • What is brace expansion?
  • Using brace expansion for patterns
4. Introduction to Regular Expressions
  • What are regular expressions?
  • Why aren't regexes consistent?
  • Basic vs. Extended Regular Expressions
  • Regex support in command line tools
  • Matching characters and words
  • Specifying occurrences
  • Alternation and grouping
  • Back references and subexpressions
5. Use Bash Extended Regexes
  • Regexes in if conditionals
  • Using BASH_REMATCH
  • Challenge: Regex to find credit card numbers
  • Solution: Regex to find credit card numbers
6. Grep EREs and PCREs
  • Using regular expressions with grep
  • Perl compatible regexes with grep
  • Performance optimizing grep searches
  • Challenge: Create a regex to find telephone numbers
  • Solution: Create a regex to find telephone numbers
7. Use sed Regexes
  • Using sed
  • Using extended regexes in sed
  • Challenge: Create a regex to find IPv4 addresses
  • Solution: Create a regex to find IPv4 addresses
8. Use AWK Extended Regexes
  • Using regexes in AWK
  • Pattern matching differences in AWK
Conclusion
  • Next steps

Taught by

Grant McWilliams

Reviews

4.6 rating at LinkedIn Learning based on 48 ratings

Start your review of Bash Patterns and Regular Expressions

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.