Premium tools, free for everyone. Most run right in your browser.

OpenMultiURL

Regex Tester

Regex Tester checks a regular expression against your text and shows matches, groups and replacement results as you type. It runs in your browser using JavaScript regex syntax, which can differ from other languages.

  • Free, no subscriptions
  • Runs in your browser
  • Checked by AK Shine
See how it works before you use your own.

What is the Regex Tester?

Regex Tester is a free tool for checking which parts of your text match a JavaScript regular expression. Enter a pattern and sample text, then change the flags to see the match count, highlighted text, capture groups and positions update as you type. You can also enter replacement text and preview the result before copying it. Developers use it to check application patterns, analysts use it to extract text, and students use it to learn how expressions behave. It runs locally in your browser, with no uploads and no subscriptions. Test several examples, including text that should not match, before using a pattern in your application.

Who it is for: Regex Tester is for developers, data analysts, QA testers, system administrators and students learning regular expressions.

How to use the Regex Tester

  1. Enter your expression in “Pattern (regular expression)” without surrounding slashes, then paste your sample into “Text to test”.
  2. Leave “Find all (g)” on to find every occurrence, or turn it off to check only the first match.
  3. Choose any needed flags: “Ignore case (i)”, “Each line (m)”, “Dot matches new lines (s)” or “Unicode (u)”.
  4. Read the count, highlighted text and match list, including groups and positions; edit the pattern or text to test another case.
  5. Optionally enter “Replace with (optional)” and inspect “Text after replacing”, then use “Copy matches” or “Copy replaced text”.

Why use it

  • See what actually matchesCompare the match count with highlighted text to spot missing or unwanted matches.
  • Inspect capture groupsCheck numbered and named groups alongside match positions to see which text your pattern captures.
  • Preview replacementsTry replacement text with group references before copying the changed text.
  • Keep test text localPatterns and text stay in your browser, and the tool works offline once loaded.

At a glance

What you put in
JavaScript regex pattern, flags, test text and optional replacement
What you get
Match count, highlights, groups, positions and replacement text
Limits
Stops at 2,000 matches; lists first 200; slow matching stopped after about 1.5 seconds
Privacy
Runs in your browser. Nothing you enter is uploaded or stored.
Price
Free for everyone. No subscriptions, no payments, no watermark.
Works offline
Yes, once the page has loaded
Last checked
by AK Shine

Worked example

Input
Pattern (regular expression): \b\d{4}-\d{2}-\d{2}\b
Find all (g): on
Text to test: Paid 2026-01-15, due 2026-02-01
Replace with (optional): [date]
Result
Paid [date], due [date]

The count is “2 matches”; “Text after replacing” shows the output above. This pattern checks the date shape, not calendar validity.

When to use something else

  • For Python, PCRE, .NET or another regex engine, confirm the pattern and replacement in that runtime because JavaScript results can differ.
  • For more than 2,000 matches or matching that takes longer than about 1.5 seconds, use a controlled test in your target runtime; this tool stops matching and lists only the first 200 matches.
  • Use a parser for nested structured data such as JSON or HTML; very old browsers may also lack lookbehind support.

Questions people ask

Why is my regex not matching the text?

Enter the pattern without surrounding slashes, and check case, spaces and anchors such as ^ and $. An invalid pattern shows the browser error under “Pattern (regular expression)”; a valid pattern with no matches may still need different flags or syntax.

How do I match every occurrence instead of only the first?

Keep “Find all (g)” checked; it is on by default. Turn it off when you want only the first match, and use “Copy matches” to copy the matching text.

How do I inspect capture groups and extract part of a match?

Put parentheses around the part you need, such as (\d+), or use a named group such as (?<amount>\d+). The match list shows numbered and named groups alongside positions, so you can check exactly what each group captured.

How do I test a regex replacement?

Enter replacement text in “Replace with (optional)” and read “Text after replacing”. Use $1 or $2 for numbered groups, $<name> for a named group and $& for the whole match, then select “Copy replaced text” when the result is right.

How do I match text across multiple lines?

Enable “Dot matches new lines (s)” when you want . to include newline characters. “Each line (m)” instead makes ^ and $ match line boundaries; it does not change what the dot matches.

Will these results match Python, PHP or .NET?

Not always: this tester uses the JavaScript regex engine built into your browser. Syntax, Unicode handling and replacement rules can differ in Python, PHP's PCRE and .NET, so confirm production behavior in the target runtime.

Is it safe to test private text here, and does it work offline?

The pattern, test text and replacement run in your browser; nothing is uploaded. The tool works offline once loaded, and it is free with no subscriptions.

Why does the match list stop, or a slow pattern get stopped?

Matching stops at 2,000 matches, and the list shows only the first 200. A very slow pattern is stopped after about 1.5 seconds of matching; try a smaller sample and simplify repeated or overlapping parts of the pattern.

Next, you might need