Bash Patterns and Regular Expressions
Offered By: LinkedIn Learning
Course Description
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
- What are globs?
- Shell expansion order
- Wildcards
- Character sets
- The effect of locale on searches
- Character classes
- Shell globbing options
- 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
- What is brace expansion?
- Using brace expansion for patterns
- 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
- Regexes in if conditionals
- Using BASH_REMATCH
- Challenge: Regex to find credit card numbers
- Solution: Regex to find credit card numbers
- 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
- Using sed
- Using extended regexes in sed
- Challenge: Create a regex to find IPv4 addresses
- Solution: Create a regex to find IPv4 addresses
- Using regexes in AWK
- Pattern matching differences in AWK
- Next steps
Taught by
Grant McWilliams
Related Courses
Mastering Regular ExpressionsA Cloud Guru Learn Raspberry Pi: Command Line
Codecademy Learn the Command Line: Redirecting Input and Output
Codecademy Automation Workflow in Adobe InDesign
CreativeLive Use Grep for Fast Search from the Command Line
egghead.io