About this tool
A regex tester lets you write and see at the same time: enter a pattern and some test text, and the tool highlights every match in real time, lists the contents of each capture group, and previews the result of a replacement. It turns the usual "you only find out if it works after you run it" pain into an instant, visible feedback loop.
It supports the common flags — g (global), i (ignore case), m (multiline) and more — so you can debug while reading the docs. From validating emails and phone numbers to extracting fields from logs and bulk-replacing text, you can prove it out here before putting it into code.
How to use
- Write the pattern in the regex field and tick flags such as g / i / m as needed.
- Paste a sample of text into the test area.
- The tool highlights every match in real time and lists the contents of capture groups (including named ones).
- To test a replacement, enter a replacement string (use $1 to reference a group) and preview the result.
- Once it behaves the way you want, copy the pattern into your code.
When to use it
- Validate input formats like email, phone or ID number with a regex.
- Extract fields such as IPs, timestamps and URLs in bulk from logs or text.
- Debug an existing pattern that always matches too much or too little.
- Design a find-and-replace rule and check the preview before applying it.
- Learn how capture groups, quantifiers and anchors actually behave.
FAQ
Which regex flavour does it use?
It uses the browser's built-in JavaScript regex engine. The syntax is largely universal, but features like lookbehind and named groups depend on your browser version and differ slightly from PCRE/Python.
What do the g, i, m flags mean?
g matches globally (all matches, not just the first), i ignores case, and m makes ^ and $ match the start and end of each line. Tick what you need.
How do I reference capture groups in a replacement?
Use $1, $2 for numbered groups, and $<name> for named groups. For example, replacing (\d+)-(\d+) with $2/$1 swaps the two number segments.
Are my pattern and text uploaded?
No. Matching, grouping and replacement all run locally in your browser in real time; neither the pattern nor the test text leaves your device.