Regex Tester guide

How to Test JavaScript Regex Matches and Capture Groups

Test JavaScript regular expressions, inspect match offsets and capture groups, handle invalid patterns and cancel patterns that exceed the worker time limit.

Open Regex Tester →

Before you start

  • Use a current browser with JavaScript enabled. Read the limits below before using private or large inputs.

Step-by-step instructions

  1. Enter the pattern without enclosing slash delimiters.
  2. Enter flags such as g, i or m, then paste the test text.
  3. Click Test regex; use Cancel if you want to stop early.
  4. Read match offsets, captured groups and named groups in the results.
  5. Adjust the pattern and run again. Example demonstrates named word captures.

Interpret results and limitations

The browser JavaScript regex engine is used, not PCRE or Python. Offsets count UTF-16 code units. Without g, only the first match is shown; zero-length global matches advance correctly in Unicode mode.

Patterns are limited to 2,000 characters and input to 100,000. Each worker has a one-second deadline and is terminated on completion, cancellation, input edits or page hiding. Results stop at 1,000 matches; displayed match text is capped at 500 characters and groups at 20.

Example

Use this example to understand the expected behavior before working with your own input.

Pattern: (?<word>[A-Za-z]+)
Flags: g
Text: Hello AnyUtils 123

Troubleshooting

The regex exceeds the time limit

Remove ambiguous nested repetition, simplify the pattern or reduce input. Cancellation terminates the worker; it does not leave matching running in the main page.

The interface does not respond

Enable JavaScript, use a supported browser and check the input limits. Reloading clears temporary input and results.

Privacy and cleanup

Inputs and results stay in the current tab. Nothing is uploaded or stored in input history. Optional analytics receives fixed tool identifiers only; entered data, file names and generated values are excluded.

Read the Privacy Policy for site preferences, optional analytics and hosting information.

Related tools and guides

Use Regex Tester with the steps above, or continue with a related task.

Technical references

These references explain the underlying formats or browser behavior. The steps above describe the current AnyUtils tool.

Usage analytics settings

Optional analytics helps us improve tools. Tool input, recordings and search text are excluded from our events. Privacy policy

Usage analytics is off unless you enable it.