๐Ÿ’พRegex

Regular Expressions

Basic Tricks
Print uncommented lines
cat example | grep -Ev "^#" | grep .
Extracts text within quotes
sed 's/"\([^"]*\)"/\1/g' filename
Swap to Unix-style
sed -i 's/\r$//' file.sh
Set a loop
until ! ./poc.sh | grep -q "[x] ERROR"; do :; done; echo "No ERROR found, script finished successfully."

Last updated