Regex Tester

Test regular expressions against sample text.

Regex Tester runs a JavaScript regular expression against multiline sample text and lists matches with indexes.

Input
Output

When to use Regex Tester

  • Prototyping validation patterns
  • Checking capture behavior quickly
  • Teaching regex flags like g and i

Example

Input

/hello/gi
Hello HTML
Say hello again

Output

#1: "Hello" @ 0
#2: "hello" @ 15

How to use

  1. Write pattern. First line must look like /pattern/flags
  2. Add sample text. Put test strings on the following lines.
  3. See matches. Run to list matches or a clear no-match result.

Processing and limitations

Uses your browser JavaScript RegExp engine, not PCRE. Put /pattern/flags on the first line and test text below it. All matches are reported with UTF-16 offsets. Processing stops after two seconds or 10,000 matches.

Reference

Benefits

  • Free to use—no account required
  • Runs in your browser
  • Instant results with no software install
  • Basic processing does not upload your content to a server
  • Invalid patterns throw. Keep the first line as a literal /.../flags form.

Not the same as

This is not a replace tool—it reports matches for inspection.

Related tools