Regex Tester

Test regular expressions against text instantly in your browser with match highlighting and a flags menu. Free online regex tester — no data uploaded.

Slash-delimited pattern with optional flags, e.g. /foo/gi

Loading calculator…

Results

Matches found
DetailValue
Matches (up to 50)
Valid regex
Error

What is this calculator for?

Test a regular expression against a sample string, show how many times it matches, and list the matched values.

How to Use This Calculator

Enter the values below, then press Calculate (or press Enter). The calculator updates your results instantly. Try different values to see how your inputs change the outcome.

  1. Regular expression — enter a text value. A typical Regular expression would be /\b[A-Z]{3}\b/g or ^[a-z]+$.
  2. Test string — enter a value. A typical Test string would be Paste the text to test against here….
  3. Review your results — the key output is highlighted, with supporting figures below.

What You'll Need

Regular expression
a text value · required
Test string
a value · required

About This Calculator

This regex tester runs your JavaScript-flavoured regular expression against a test string and reports every match.

Enter a pattern as /pattern/flags (slash-delimited with optional g, i, m, s, u, y flags) or a bare pattern. The tool uses global matching so it finds all occurrences, lists up to the first 50 matches, and validates the pattern — showing the parser error if it is malformed.

Testing runs entirely in your browser.

Worked Examples

Example

3 matches

Frequently Asked Questions

Which regex flavour is this?
JavaScript (ECMAScript) — the same engine used in browsers and Node.js. Lookaheads, backreferences, and Unicode properties are supported.
Why does my pattern only show one match?
Add the g (global) flag to the pattern — /foo/g — or the tester will show the first match only.