Regex Tester

Type a JavaScript regular expression and the text you want to test. Matches are marked in the preview. This tester does not rewrite the text. Use Find and Replace when you need a substitution.

Limit: 400 KB of text, 200 characters for the pattern. Allowed flags: g i m s u y. Ctrl or Cmd+Enter refreshes the matches.

Result

Matches
0

Highlighted text


          

What this tester uses

The engine is the regular expression object already in this browser. Flags are the usual JavaScript set: g for global, i for ignore case, m for matching across lines, s for dot-all, u for Unicode, and y for sticky. The tester always walks the string with a global search, so every match can be listed, even if you omit g.

A pattern that matches too often is stopped after 2,000 hits. The preview lists the first 200. That cap keeps the tab usable. Capture groups appear next to each listed match when the pattern has parentheses.

When this tool helps

Use the tester when you are checking a validation pattern, a search, or a cleanup expression against a sample you already have. It does not run the pattern against a website, a file system, or anyone else’s text.

Questions

Why did a valid-looking pattern fail?

The status line shows the browser’s parse message. Common causes are an unclosed bracket or an unknown flag.

Can I replace from here?

No. This page only reports matches. Open Find and Replace and turn on “Treat find as a regular expression” to rewrite the text.

Does the text leave this tab?

No. The test runs in the browser from the boxes you see.