From the course: Bash Patterns and Regular Expressions

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Challenge: Regex to find credit card numbers

Challenge: Regex to find credit card numbers - Bash Tutorial

From the course: Bash Patterns and Regular Expressions

Challenge: Regex to find credit card numbers

(upbeat music) - [Instructor] In this challenge, I want you to use the sales.csv file in the chapter five directory of the exercise files. Using Bash's in-process regular expression support, make a short Bash script that loops through the lines and finds Visa numbers only. For each number print it on the screen. Try not to Google the answers to these challenges. Work through them with the knowledge you've gained in this course. For a slightly harder challenge, watch the Sed chapter first and then return to your script in this video and print the credit card numbers on the screen with hyphens every four characters.

Contents