Home » Developer Tools » Regex Tester

Free Regex Tester Online

Test regular expressions live - matches highlighted as you type.

Last updated 13 November 2026

Type a pattern and test string to see live matches.

Match details

BotixTech's free regex tester helps you build and debug regular expressions with instant feedback. Type a pattern, paste a test string, and every match lights up as you type.

Toggle flags like global, ignore-case and multiline, inspect capture groups per match, or start from a common preset like email or URL validation.

How to Test a Regex

  1. Enter your pattern - without the surrounding slashes, just the expression.
  2. Pick flags - g for all matches, i to ignore case, m for multiline, and more.
  3. Paste a test string - matches highlight live in purple.
  4. Inspect matches - each match shows its index and capture groups below.

Regex Tester Features

What Is a Regular Expression

A regular expression, often called a regex, is a short pattern that describes a shape of text. You write the pattern once, and the tester checks it against any text you paste in, showing every part that fits the shape. Developers use patterns to check email addresses, pull phone numbers out of a message, find dates in a log file, and split messy text into tidy pieces.

This tester runs on JavaScript only. It uses the RegExp engine built into your browser, so it understands JavaScript patterns and the six JavaScript flags. A pattern written for another engine, such as PCRE or Python, may match different text here or fail with an error, so test it here before you trust it in your own code.

Worked Example Finding Digits

Here is a small test you can repeat in the tool. Type the pattern \d+ in the pattern box and paste abc 123 def 456 as the test string. The pattern \d+ means one or more digits in a row.

The tool reports 2 matches found. Match 1 is 123 at index 4, because the letters a, b and c take positions 0, 1 and 2, the space takes position 3, and the digits start at position 4. Match 2 is 456 at index 12, after the space at position 11. Both matches are highlighted in the test string, and both appear in the match details below it.

Try the email preset next. Choose Email address from the Common patterns list and the pattern box fills in at once. Against the sample text already in the test string box, it finds 2 matches: the two email addresses in the sample. That is the fastest way to check a preset before you use it in your own project.

The Seven Presets

The Common patterns list holds seven ready made patterns. Pick one and it fills the pattern box, so you can test it at once or change it to fit your own text.

The Six Flags

Flags change how the pattern is applied. Tick a box to turn a flag on, and the matches update at once. The g flag is checked when the page loads.

What This Tester Cannot Do

This tester highlights matches. It does not change your text, so there is no replace box and no replacement preview. If you need to change matched text with a pattern, do that in your own editor or code, not here.

There is also no pattern explainer and no syntax reference on the page. The match details list shows the first 50 matches only, even when the count above it is higher. Named groups are another limit: if your pattern uses a named group, its matched text appears in the groups list, but the name itself is not shown next to it. The tool lists the values only.

Finally, matching runs in your browser with no time limit. A pattern that backtracks heavily on a long test string can freeze the tab, so keep test strings short while you work on a tricky pattern.

Tips for Testing a Pattern

Test the pattern against text that should match and text that should not match. A pattern that matches everything tells you nothing, and a pattern that matches nothing may be too strict.

Start with the g flag on so you see every match, then turn flags off one at a time to see what each one changes. If the error box appears, read the exact JavaScript message: it names the problem, such as an unclosed bracket. Keep the sample text short while you build the pattern, then paste the real text in once the pattern works.

Frequently Asked Questions

What is a regular expression?

A regular expression (regex) is a mini language for describing text patterns. Developers use it to validate emails, find phone numbers, extract data from text.

Which flags are supported?

All six JavaScript flags: g (find every match), i (ignore case), m (^ and $ match line starts and ends), s (dot matches newlines), u (unicode mode) and y (sticky matching).

Why does my pattern show an error?

The exact JavaScript error is shown above the results. The usual cause is an unescaped special character like an unclosed bracket or a stray backslash.

Is my test data uploaded anywhere?

No. The regex engine is your browser's own JavaScript engine, so your pattern and test text never leave your device.

Which regex flavour does this tester use?

JavaScript only. The tester uses the RegExp engine built into your browser, so it runs JavaScript patterns and the six JavaScript flags. A pattern written for PCRE, Python or another engine may match different text here or show an error, so test it here before you use it in your own code.

Can I test a replacement here?

No. This tester only highlights matches in your test string. There is no replace box and no replacement preview, so it cannot rewrite your text. If you need to change matched text, use your own editor or code once the pattern tests cleanly here.

What are capture groups, and what about named groups?

A capture group is a part of a pattern inside round brackets. When that part matches, its text appears in the groups list next to the match in the match details. If you use a named group, its matched text appears in the same list, but the name itself is not shown. The tool lists the values only.

How many matches does the tester show?

The count above the results shows the total number of matches. The match details below list the first 50 matches, each with its index and its capture groups. If your text has more than 50 matches, the list stops at 50 and notes how many more there are.

Can a pattern freeze my browser tab?

Yes, it can happen. Matching runs in your browser with no time limit, so a pattern that backtracks heavily on a long test string can freeze the tab. Keep test strings short while you build a pattern, and close the tab if it stops responding. Your pattern and test text stay on your device either way.