Regex Tester

Test JavaScript regular expressions against sample text with live match highlighting, capture groups, and flag controls.

Files and content are processed locally in your browser and are not uploaded to our server.

About this tool

Create and test regular expressions with immediate feedback. Set pattern and flags (g, i, m, s, u, y), run against sample text, see highlighted matches, inspect capture groups, and copy match results—all using the same RegExp engine as your browser JavaScript.

How to use

  1. Live match highlighting in sample text
  2. Configurable flags: global, ignoreCase, multiline, dotAll, unicode, sticky
  3. Capture group table with indexed values
  4. Match count and index list
  5. Common pattern snippets for quick start
  6. Enter pattern: Type your regex in the pattern field and select flags.
  7. Add test string: Paste the text you want to match against.
  8. Inspect matches: Review highlights, groups, and errors inline.

Examples

Limitations

FAQ

Why does my pattern show a syntax error?
JavaScript regex has specific escaping rules. Invalid escapes or unclosed groups trigger parse errors shown in the panel.
What is the dotAll (s) flag?
It makes . match newline characters, useful for multi-line logs.
Can I test replace operations?
This tool focuses on matching and groups; use the Text Cleaner tool when you need to replace matching text.
Are matches global by default?
Enable the g flag to find all matches; without it, only the first match is returned.