Skip to main content
ToolNara
Local browser utilityLocal Regex

Regex Tester: Match, Replace, and Debug Patterns

Test JavaScript regular expressions locally with flags, match positions, named groups, replacement preview, and export.

Flags
Matches3 found
#1 at 16https://api.toolnara.site:443
protocol: httpshost: api.toolnara.siteport: 443
#2 at 71https://toolnara.site
protocol: httpshost: toolnara.siteport: (empty)
#3 at 115http://status.toolnara.site
protocol: httphost: status.toolnara.siteport: (empty)
Replacement preview0 chars
Enter a replacement string to preview the transformed text.

The match inspector scans up to 100 matches. The global flag controls whether every match is collected. JavaScript regular expressions can be expensive on large inputs, so keep patterns and test text within the visible limits.

Local processing: ToolNara processing code keeps the working value in browser memory. It does not intentionally send the value to an application server.

No input telemetry

Engineering guide

JavaScript Regex Tester: Flags, Groups, Replacement, and ReDoS Boundaries

Debug regular expressions in the browser with JavaScript flags, named groups, replacement previews, and safe input limits.

Read guide

How to use Regex Tester: Match, Replace, and Debug Patterns

Step 1

Enter a Pattern

Type a JavaScript regular expression and select the flags that match your use case.

Step 2

Inspect Matches

Paste test text and review match values, positions, numbered groups, and named groups.

Step 3

Replace and Export

Add a replacement string, inspect the preview, then copy or download the result.

Capabilities and standards

Native JavaScript RegExp execution with global, case-insensitive, multiline, dot-all, Unicode, and sticky flags
Match inspector shows value, position, numbered groups, and named groups
Replacement preview uses JavaScript replacement syntax and stays in browser memory
Load sample URL patterns, copy the result, or download the transformed text as a .txt file
Conservative 100,000 character test-text limit and 100 match inspection limit protect the main thread
Advertisement
Advertisement placement reserved for editorial content

Developer reference

Programmatic implementation

Use these examples as implementation references. Check the runtime and test vectors before using them in production.

JavaScriptInspect named groups with a global regular expression
const pattern = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/g;
const source = 'Release 2026-09-25';

for (const match of source.matchAll(pattern)) {
  console.log(match.groups);
}
PythonTest a regular expression in Python
import re

match = re.search(r'(?P<year>\d{4})-(?P<month>\d{2})', 'Release 2026-09-25')
print(match.groupdict() if match else 'No match')

Frequently asked questions

Is my test text uploaded?

No. The pattern, test text, match inspection, and replacement preview run inside your browser using the native RegExp API.

Which regular expression flags are supported?

The tester exposes g, i, m, s, u, and y flags. The browser validates the final expression and reports invalid flag combinations.

Can a regex lock up the browser?

A poorly designed pattern can consume significant CPU on a large input. The tester limits input and match inspection, but it cannot make an unsafe pattern safe.

Related utilities