# Regular Expression

*noun*

say it: **“REG-yuh-ler ek-SPRESH-un”** **/ˈrɛɡjələr ɪkˈsprɛʃən/**

A pattern that describes text instead of spelling it out, such as "one or more digits", used to find, check or pull out matching parts of text.

## What is a **regular expression**?

A **regular expression** is a pattern for finding or checking text, like "three digits, a dash, four digits". Python's is the `re` module.

```python
import re
text = "Call 555-0199 or 555-0142"
print(re.findall(r"\d{3}-\d{4}", text))  # ['555-0199', '555-0142']
```

## In a sentence

- “The **regular expression** (\\d+) pulled 30 out of "about 30 min".”
- “One **regular expression** found every phone number in the file, however it was spaced.”

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 19, 2026

## In other subjects

- [Regular Expression in C#](https://www.ask-codey.com/glossary/regular-expression-c-sharp)
- [Regular Expression in Java](https://www.ask-codey.com/glossary/regular-expression-java)
- [Regular Expression in JavaScript](https://www.ask-codey.com/glossary/regular-expression-javascript)
- [Regular Expression in PowerShell](https://www.ask-codey.com/glossary/regular-expression-powershell)

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