# 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.

```bash
grep -E '^[0-9]{3}-[0-9]{4}$' phone-numbers.txt
```

Level: Freelancer · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=4)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/regular-expression-in-the-shell
