‹ Back to Software

Regex Tester

Test JavaScript patterns, flags, groups, and replacements in a worker.

Pattern

Highlighted matches

Groups (up to 1000 matches)

No matches.

Replace preview


What Regex Tester does

Test JavaScript patterns, flags, groups, and replacements in a worker.

How to use it

  1. Enter a JavaScript pattern without slash delimiters and choose flags.
  2. Enter test text and a replacement. Highlighted matches and numbered / named groups update after a short pause.
  3. Read the replacement preview. A pattern that exceeds one second is terminated in its worker.

Formats and limits

  • Text up to 200,000 characters, up to 1000 displayed matches. Each run has a 1 second limit. Patterns that time out are terminated.

Examples and checks

Capture values from a short log line

Enter item=(\d+) without slash delimiters and test it against item=12 item=34. Enable g to show both matches. Replacement text id=$1 produces id=12 id=34, using the first captured group in each match. Turn g off to compare how only the first occurrence is replaced.

JavaScript flags change interpretation: i ignores letter case, while m affects line anchors. This tester uses JavaScript patterns, so a pattern copied from another language may behave differently. Start with a small representative sample and inspect both matches and replacement output before editing a whole document. A one-second timeout stops a slow worker; it is a signal to simplify the pattern, not evidence that it would be safe or fast on every input.

Privacy

Processing stays in this tab. Input and generated content are not uploaded or stored.

Related tools

All processing runs locally in your browser. This tool is provided as-is without warranty. Keep backups of your original files before processing.

By selecting media, you confirm you own the content or have permission to modify it. Please read the Terms and Conditions.