Advertisement

Regex Tester

Test, debug and replace regular expressions with live match highlighting, group capture, replace mode and a pattern library.

/ /
No capture groups or no matches.
Matches will appear here.

Frequently Asked Questions

What is a regular expression (regex)?
A regular expression is a sequence of characters that defines a search pattern. It is used to find, match, extract, or replace text in strings. Regex is supported in virtually every programming language including JavaScript, Python, PHP, Java, and most text editors.
What do the regex flags mean?
The most common flags are: g (global — find all matches, not just first), i (case-insensitive — match regardless of upper/lowercase), m (multiline — ^ and $ match start/end of each line), and s (dotAll — dot matches newline characters too).
Why is my regex not matching?
Common issues: forgetting to escape special characters like . * + ? ( ) [ ] { } \ ^ $, using the wrong flags (missing g for all matches), and anchor misuse (^ and $ mean start/end of string unless multiline flag is set). Use the preset examples in the tester to learn the patterns.
✓ Link copied