Skip to content
ErgaLab
Regex

Regex Generator

Choose what you're trying to match from a list of common patterns, adjust a couple of options, and get a ready-to-use regular expression.

What do you want to match?

Matches most common email address formats.

Generated pattern

\b[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}\b

Example match: hello@formulaforge.dev

How it works

Writing a regular expression from scratch means remembering character classes, escaping rules, and quantifier syntax. This tool instead offers a library of common matching needs — email addresses, URLs, phone numbers, dates, IP addresses, and more — each with a couple of toggles for common variations.

Once you have a pattern, test it against your own text with the Regex Tester, or paste an existing pattern into the Regex Explainer to understand it piece by piece.

Examples

Email address

Common email formats.

\b[\w.+-]+@[\w-]+\.[a-zA-Z]{2,}\b

ISO date

YYYY-MM-DD formatted dates.

\b\d{4}-\d{2}-\d{2}\b

Hex color

3 or 6 digit hex colors.

#(?:[0-9a-fA-F]{3}){1,2}\b

Frequently asked questions