Developer Utilities

JavaScript Regex Tester

Try a regular-expression pattern against sample text and inspect every matched value and starting position.

Flags

What is this tool?

The tester compiles a JavaScript regular expression and applies it to your text. It lists complete matches, capture groups when present, and zero-based character indexes.

How to use

  1. Enter a pattern without slash delimiters.
  2. Select the flags your pattern needs.
  3. Paste test text.
  4. Run the test and review match positions.

Example

\d+ matches each run of digits, while the i flag makes letter matching case-insensitive.

FAQ

Which regex flavor is used?

Your browser's JavaScript regular-expression engine.

Why is global matching always shown?

The tester finds every occurrence so it can report a useful match count; your selected flags otherwise stay intact.

Can a pattern freeze the page?

Some pathological patterns can cause heavy backtracking. Test untrusted or complex expressions with care.

Related tools