Regex Wizard

Build regular expressions interactively without knowing regex syntax - use the pattern builder or choose from pre-built patterns.

Loading...

What is a Regular Expression (Regex)?

A regular expression (regex) is a pattern used to match text. It's like a powerful search tool that can:

Common Use Cases

Quick Regex Reference

The Slashes and the Letters After Them

The pattern above is shown as /pattern/g. The two slashes are not part of the pattern: they only mark where it starts and ends, the way quotation marks do for text. The letters after the second slash are options for the whole pattern:

So /cat/gi finds every "cat", "Cat" and "CAT". JavaScript writes patterns exactly this way. Most other languages and tools, such as Python, take only the part between the slashes, which is what the Copy button gives you; there the options are set separately.

Tip: Start with a preset pattern and modify it, or build a custom pattern step-by-step. Test your pattern against real text to see what it matches!

Report a problem with this tool