Test JavaScript regular expressions against sample text and see matches immediately. Debug patterns for validation, search-and-replace, or data cleanup.

Regex tester

JavaScript-style regular expressions. Be careful with untrusted patterns on huge text.

Matches (4)
  • Helloindex 0
  • regexindex 6
  • worldindex 12
  • 123index 18

How to use Regex tester

  1. Enter a regex pattern (with or without slashes).
  2. Paste sample text to search.
  3. Review match count and matched segments.
  4. Adjust flags or pattern until it behaves as expected.

Example: Pattern \d{3}-\d{4} finds simple US-style phone groups in a string.

Frequently asked questions

Which regex flavor does this use?
It uses the JavaScript regular expression engine, so behavior matches what you would get in browser and Node.js code.
Why does my pattern match nothing?
Check for unescaped special characters and missing flags such as the global or case-insensitive flag, which change how matches are found.