Skip to main content

Run browser JavaScript regex in isolation and view matching text, UTF-16 positions, capturing groups, and named groups. Provides flags switches and examples, stops with timeout, and displays up to 500 matches.

Use browser JavaScript regular syntax, not equivalent to PCRE. Expression maximum 2,000 characters; 500 millisecond timeout, maximum 500 matches; index calculated as UTF-16.

24 / 30,000 characters

Shortcut key: Ctrl/⌘+Enter. Modifying inputs or options clears old results.

Instructions for use

  1. Fill in the expression and test text without the / on both sides.
  2. Select flags such as g, i, m, s, etc., or load the named grouping example.
  3. Click Test Match to view match locations and groupings item by item, copying the full JSON if necessary.

Input and output examples

Example input
表达式:(?<letter>[A-Z])-(?<number>\d+) 文本:A-123 标志:g
Example output
匹配:A-123,位置 0 letter:A number:123

\d represents a number, + represents one or more; parentheses are used to capture groups.

FAQ

The browser JavaScript engine is used here, not PCRE, Python or Java. The syntax and flags should be consistent with the actual running environment.

The regex runs in a separate worker thread and will terminate after 500 milliseconds. Test text can be up to 30,000 characters, expressions can be up to 2,000 characters, and a maximum of 500 matches are returned.

Calculation basis and reference materials

Use JavaScript regular rules to display matching positions and capturing groups; matching will stop if it takes too long. Mode behavior is specific to current browsers and is not equivalent to PCRE or other language implementations.

Content check: · About this site and content description

Related tools