Inspectors

RegExp Tester

Write a regex and test it against a sample string in real time. The tool shows all matches, capture groups, and group names with highlighting. Supports all JavaScript regex flags (g, i, m, s, u, y, d) and shows match indices when the d flag is used. Error messages explain what's wrong with invalid patterns.

RegExp Tester — Test a regular expression against a string, inspect matches and groups

What it does

  • Tests regex patterns against input text with real-time match highlighting
  • Shows all matches, capture groups, and named groups
  • Supports all JS regex flags: g, i, m, s, u, y, d
  • Displays match indices when the d (indices) flag is used
  • Reports regex syntax errors with explanations

Use cases

  • Debugging a regex that's not matching as expected
  • Testing capture groups before using them in code
  • Experimenting with regex flags to understand their effect
  • Validating a pattern before deploying it in production

How it works

1

Enter your regex pattern in the pattern field

2

Set the flags you need (g for global, i for case-insensitive, etc.)

3

Paste your test string into the input pane

4

Matches and groups are highlighted and listed in the output

Frequently asked questions

1Which regex engine does it use?

The tool uses the JavaScript regex engine (the same one in Node.js and browsers). This means it supports the same syntax and flags as JavaScript. If you're testing regex for Python or Go, the syntax may differ slightly.

2What does the d flag do?

The d flag (added in ES2022) enables match indices. With it, the tool shows the start and end position of each match and each capture group. Without it, you only get the matched text, not its position.

3Can I test lookbehind assertions?

Yes, if your browser supports them (all modern browsers do). Lookbehind (?<=...) and negative lookbehind (?<!...) are supported by the JavaScript engine in modern environments.

Related tools

Use RegExp Tester offline in Devinity

All 95 tools run locally on your Mac. No internet required, no data sent to servers.

Download Devinity →