Skip to main content
ToolstikToolstik

Regex Tester

Processed in your browser

A regex tester runs a JavaScript regular expression against sample text with live highlights, capture groups, and flags. Patterns that run too long time out after 2 seconds so catastrophic backtracking cannot freeze the tab.

What this tool does

A regex tester runs a JavaScript regular expression against sample text with live highlights, capture groups, and flags. Patterns that run too long time out after 2 seconds so catastrophic backtracking cannot freeze the tab.

Features

  • Match highlighting
  • Capture and named groups
  • Flag toggles
  • Match count
  • Backtracking timeout

How to test a regular expression

  1. Enter a pattern without slashes, for example \d{3}-\d{4}.
  2. Toggle flags such as Global (g) or Ignore case (i).
  3. Paste test text and click Test regex.
  4. Review highlighted matches and the capture-group table.

Why Toolstik

The timeout is real (a worker), not a marketing line. Flags and groups match how the browser's RegExp actually behaves.

Example: find phone numbers

Input
Pattern \d{3}-\d{4} with flag g Text: Call 555-0142 or 555-0199
Result
2 matches: 555-0142, 555-0199

Common uses

  • Build validation patterns for forms (emails, phone numbers, postcodes).
  • Extract values from logs before writing a script.
  • Debug search-and-replace patterns for your editor.

Supported formats

  • JavaScript (ECMAScript) regex syntax

Limits

  • 100,000 characters of test text
  • First 1,000 matches

Limitations

  • PCRE-only features (possessive quantifiers, recursion) are not available.
  • Patterns that run longer than 2 seconds are stopped.

Privacy

Matching runs in a background worker in your browser; text is not uploaded.

Frequently asked questions

Related guides

Browse the free developer toolkit for every related tool and guide.