Regular Expression in the Shell
say it: “REG-yuh-ler ek-SPRESH-un in thuh SHEL” /ˈrɛɡjələr ɪkˈsprɛʃən ɪn ðə ˈʃɛl/
A text-matching pattern used by grep, sed and awk.
What is Regular Expression in the Shell?
A regular expression is a pattern for matching text, used by grep, sed and awk. ^ means line start, $ line end, . any character, * repeat.
grep -E '^[0-9]{3}-[0-9]{4}