All tools

DEV / 023

Regular Expression Tester

Test JavaScript regex patterns and inspect every match instantly.

Private workspaceYour input stays on this device. HaloBench tools run in your browser whenever possible.
Matches
1. [23] Tools
2. [36] Place

Guide / 01

When to use it

Use it to find error-code formats in a log or verify a JavaScript validation expression against both valid examples and cases that should fail.

Guide / 02

Quick guide

  1. Enter the expression body without surrounding slashes and put JavaScript flags in the separate field.
  2. Provide test text containing positive examples and deliberate counterexamples.
  3. Review each matched value and start index, revise the pattern, and rerun all counterexamples.

Check

Validate the result

With the pattern \d+ and text A12 B003, the output should contain two matches, 12 and 003, at different indices.

Limits

Know the limits

The engine follows JavaScript RegExp syntax and global matching is applied automatically. Capture-group details are not listed, and inefficient nested quantifiers can make a tab unresponsive on long input.

Reference

Input and output example

Use the same units and settings when comparing your result with this example.

Example input
Pattern: \b[A-Z][a-z]+\b · flags: g · text: Red blue Green
Result and interpretation
1. [0] Red 2. [9] Green Numbers in brackets are zero-based string indices.

FAQ

Frequently asked

Should I include the / slashes around the regular expression?

No. Enter only the body that normally appears between the slashes, and put flags such as g, i, or m in the flags field.

Does my data leave this device?

No. This tool is designed to process its working data in your browser. Advertising may load separately, but your tool input is never sent with it.