DEADeveloper Engineering AtlasDeveloper workspace

Local · Your input stays in the browser

JavaScript Regular Expression Tester

Test JavaScript patterns, flags, all matches, and UTF-16 indexes.

Workspace

Guide and technical reference

How to use

Enter a JavaScript RegExp pattern without /.../ delimiters, optional flags, and test text. The tool lists all matches and their start indexes using the current browser engine. It automatically adds g when omitted so every matching item is shown.

  1. Enter only the pattern source, such as \d+; do not include slash delimiters.
  2. Enter supported browser flags such as g, i, m, s, or u. The tool adds g if it is absent.
  3. Paste test text and compare the match count, matched text, and zero-based index.
  4. Treat a syntax error separately from a valid expression that finds zero matches.

Examples

Input
pattern \d+; flags g; text order 42 and 7
Output
42 at index 6; 7 at index 13

Indexes are zero-based positions in the JavaScript string.

Input
pattern dea; flags i; text DEA dea
Output
DEA at index 0; dea at index 4

The tool adds g to the supplied i flag and therefore lists both case-insensitive matches.

Input
pattern [
Output
JavaScript regular-expression syntax error

An unclosed character class is invalid rather than a no-match result.

Understanding the result

Match count is the number of items returned after global matching; an omitted g flag is added automatically.

Match text is the complete match. The current UI does not break capture groups into separate columns.

Index is zero-based and counted in UTF-16 code units, so it may differ from the number of visible Unicode characters.

Pattern behavior and supported flags follow the current browser JavaScript RegExp implementation, not Java, PCRE, RE2, or .NET.

Common errors and limitations

  • This version does not provide replace, capture-group columns, performance isolation, or a timeout.
  • A costly backtracking expression runs synchronously and can make the page temporarily unresponsive; do not test hostile patterns on large input.
  • A zero match count is a valid result. Syntax errors appear separately and clear the match list.
  • All testing stays in the browser and is not sent to the DEA server.

Frequently asked questions

Why does this differ from Java or PCRE?
Regular-expression engines have different syntax, Unicode rules, flags, and features. This page uses browser JavaScript RegExp.
How is no match different from a syntax error?
No match means a valid expression produced zero results; a syntax error means the engine could not construct the expression.
Why do flags change the result?
Flags alter engine behavior, such as i for case-insensitive matching, m for line anchors, s for dot-newline behavior, and u for Unicode-aware parsing.

← Back to all tools