Developer

Processed locally

JavaScript Regex Tester

Try a JavaScript regular expression against sample text and inspect matching substrings and their starting positions. Pattern and flag changes update the result.

Tool options · presets, sharing & more

Presets & sharing: options only, never files, text or passwords. Undo/redo: editable form values, not file selection or generated results.

How to Use Regex Tester

1

Enter the pattern without surrounding slash delimiters.

2

Enter flags separately, such as g or i.

3

Paste sample text into Test String.

4

Review the match list and indexes, or correct a reported pattern error.

What This Tool Does

Builds a native JavaScript RegExp from the pattern and flags. With g enabled it lists successive matches; otherwise it reports the first match. Indexes refer to positions in the JavaScript string.

Common Use Cases

Testing a search pattern against example log lines.
Checking how case-insensitive or global flags change a match.
Reviewing a pattern before adding it to JavaScript code.
Privacy & Processing

This tool processes files and input in this browser tab. Its processing code does not upload them to a server. Loading this page and fetching uncached app files uses an internet connection. Optional usage analytics requires your consent and excludes input, filenames, passwords and generated content. Form undo history and result transfers stay in session memory. Explicitly saved presets contain approved settings only.

Offline use is not verified for this tool. Keep an internet connection available to load its page, code and any additional dependencies.

Frequently Asked Questions

Which regular-expression flavor does this use?

Your browser's JavaScript RegExp implementation. Patterns for PCRE or other languages may behave differently.

Why do I see only one match?

Without the g flag the tool reports the first match. Add g to list successive matches.

Does this tool work offline?

Offline use is not verified for this tool. Keep an internet connection available to load its page, code and any additional dependencies.