Introduction
You use regex inside [[ ]] with =~ to check if a string matches a pattern easily in bash scripts.
Checking if a user input contains only numbers.
Finding if a filename ends with .txt before processing it.
Validating if an email address looks correct in a script.
Detecting if a log line contains a specific error code.