# Regex tester

> Test a JavaScript regular expression against your text: every match with its index and capture groups, named groups, and a live replace preview.

URL: https://tools.cuelark.com/regex-tester
Publisher: Cuelark Team (https://cuelark.com)
Updated: 2026-11-10
Price: free, no sign-up
Privacy: runs in the browser; files are not uploaded

Type a regular expression and some text to see every match, its position and its capture groups (named groups too), and preview a replacement with $1 or $<name>. Uses your browser's JavaScript regex engine.

## How to use it

1. Enter the pattern without slashes and the flags (g, i, m, s, u, y).
2. Paste the test text; matches update as you type.
3. Add a replacement to preview it, then copy the result or download the matches as CSV.

## Details

- **Flavor:** JavaScript (ECMAScript 2024): lookbehind, named groups, Unicode properties with u or v
- **Limits:** Pattern up to 1,000 characters, text up to 100,000, first 500 matches
- **Replace:** $1…$9, $<name>, $& (whole match)

## Questions

### Will a regex that works here work in Python or PHP?

Mostly, for common syntax. Differences include named groups ((?P<name>) in Python), possessive quantifiers and some flags. This tester is JavaScript only.

### Why do I only get one match?

Without the g flag a regex stops after the first match. This page always searches globally, so add your own flags for case (i) or multiline anchors (m).

### How do I match a literal dot or bracket?

Escape it with a backslash: \. matches a dot, \[ a bracket. Inside a character class, most characters are literal, like [.].

### What does the s flag do?

It lets . match line breaks too. Without it, . stops at the end of a line.

### Is what I type sent anywhere?

No. The calculation runs in this browser tab with the same code our MCP server uses. Nothing you type is sent to a server or saved, apart from settings like filing status, which stay in this browser.

### Can an AI agent use this?

Yes. The same function is a tool on our free MCP server at tools.cuelark.com/mcp, so ChatGPT, Claude or Cursor get exactly the answer this page shows. 'Copy MCP call' gives you the arguments.

## Related tools

- [Case converter](https://tools.cuelark.com/case-converter)
- [CSV to JSON converter](https://tools.cuelark.com/csv-to-json)
- [Word counter](https://tools.cuelark.com/word-counter)
- [Markdown preview](https://tools.cuelark.com/markdown-preview)
