Regular expressions are a core skill for any half decent programmer.
I use them extensively in languages from Python and Perl to Java/Scala/Groovy and even in shell scripts in Bash for grep, sed & awk.
The gold standard from Perl which most popular languages aspire to
GNU grep has a grep -P
switch to use PCRE but beware it's not portable. It won't work on BSD based systems like macOS.
On Mac you can install coreutils to get the better GNU Grep
brew install coreutils
but then you'll have to use the ggrep
command instead.
Your shell scripts will have to figure our if they're on Mac and override the grep command (examples in DevOps-Bash-tools repo).
This is the neutered regex that old grep uses.
Slightly better than BRE but still weak & awkward compared to PCRE.
Don't support back references.
Grep on most systems can support EREs via the grep -E
switch.
Awk also uses EREs.
PCRE regex:
PCRE regex:
BRE / ERE Regex:
PCRE regex - see especially anonymize.py / anonymize.pl in these repos among many other scripts: