Regular Expression Tester

Test JavaScript regular expressions, capture groups, and replacements online.

Inspect JavaScript regular expression matches, positions, capture groups, and replacement previews. Expressions run in an isolated Worker and are stopped when they exceed the time limit.

Loading...

Examples and limits

Pattern (\\w+)=(\\d+) applied to a=1 with replacement $1:[$2] produces a:[1]. JavaScript regular-expression syntax is used; pattern, input, and result counts are bounded, and the Worker stops timed-out runs. Test text is not uploaded.

How to use

Enter a pattern and test text, select flags, and run a match or replacement. Complex expressions are protected by a Worker timeout, and content is processed only in the browser.

Supported flags

  • g global matching
  • i case-insensitive matching
  • m multiline mode
  • s dot-all mode
  • u Unicode mode
  • y sticky matching

The tool limits pattern length, input size, and match count. The timeout reduces page-freeze risk, but production systems should still avoid unrestricted complex expressions from untrusted users.

Licensed under CC BY-NC-SA 4.0

Report a problem

The links prefill this page's title and address. Add what happened and how to reproduce it.