Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Bash Patterns and Regular Expressions

Bash Patterns and Regular Expressions

2h 2mAdvanced2019-06-06

Authors

Grant McWilliams

Grant McWilliams

Consultant, Speaker, Writer, Professor, Developer

Course details

Pattern matching allows you to create a script that can act on pieces of data if it matches a specific pattern. This makes it possible to script automation into a system process. In this course, learn how to use pattern matching in a Bash script using globs, extended globs, brace expansion, and regular expressions (regex). Throughout this course, Grant McWilliams covers the differences between basic and extended regexes and delves into using extended regexes in bash conditional statements, grep, sed, and AWK.

Learning objectives
What are globs and extended globs?
How locale affects searches
Making extended globs persistent
Comparing extended globs with regular expressions (regexes)
Using brace expansion for patterns
Working with extended regexes
Using sed
Regexes in AWK

Skills covered

BashIT AutomationNetwork and System AdministrationOpen SourceDeep Dive (X:Y)

Concepts

0. Introduction

  • 01 - Use Bash to pull data in seconds
  • 02 - What you should know

1. Shell Globs

  • 03 - What are globs
  • 04 - Shell expansion order
  • 05 - Wildcards
  • 06 - Character sets
  • 07 - The effect of locale on searches
  • 08 - Character classes
  • 09 - Shell globbing options

2. Shell Extended Globbing

  • 10 - What are extended globs
  • 11 - Why you should use extended globs
  • 12 - Make extended globs persistent
  • 13 - Getting started with extended globs
  • 14 - Pattern matching with extended globs
  • 15 - Using extended globs with commands
  • 16 - Comparing extended globs with regular expressions

3. Shell Brace Expansion

  • 17 - What is brace expansion
  • 18 - Using brace expansion for patterns

4. Introduction to Regular Expressions

  • 19 - What are regular expressions
  • 20 - Why aren't regexes consistent
  • 21 - Basic vs. Extended Regular Expressions
  • 22 - Regex support in command line tools
  • 23 - Matching characters and words
  • 24 - Specifying occurrences
  • 25 - Alternation and grouping
  • 26 - Back references and subexpressions

5. Use Bash Extended Regexes

  • 27 - Regexes in if conditionals
  • 28 - Using BASH REMATCH
  • 29 - Challenge - Regex to find credit card numbers
  • 30 - Solution - Regex to find credit card numbers

6. Grep EREs and PCREs

  • 31 - Using regular expressions with grep
  • 32 - Perl compatible regexes with grep
  • 33 - Performance optimizing grep searches
  • 34 - Challenge - Create a regex to find telephone numbers
  • 35 - Solution - Create a regex to find telephone numbers

7. Use sed Regexes

  • 36 - Using sed
  • 37 - Using extended regexes in sed
  • 38 - Challenge - Create a regex to find IPv4 addresses
  • 39 - Solution - Create a regex to find IPv4 addresses

8. Use AWK Extended Regexes

  • 40 - Using regexes in AWK
  • 41 - Pattern matching differences in AWK

Conclusion

  • 42 - Next steps

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal