# Regex Tester

> Free regex tester. Try JavaScript regular expressions against sample text with live highlighting, flag toggles and capture group display. All client-side.

Test JavaScript regular expressions live against your own text. Matches highlight instantly, flags toggle with checkboxes, and capture groups are listed below.

*Interactive tool: enter your values at https://toollantern.win/regex-tester/ and results update instantly in your browser.*

## What the tool does

Type a pattern and it is tested against your text as you type, using the JavaScript regex engine. Matches are highlighted, the count is shown, and capture groups are listed. Toggle flags with the checkboxes: g for all matches, i to ignore case, m for multiline ^$, s so dot matches newlines, u for Unicode mode.

## Worked example

The sample pattern \b[A-Z][a-z]+\b finds capitalized words. Against "Ada and Grace wrote code in 1843." it matches **Ada** and **Grace**: 2 matches.

## Cheat notes

\d digits, \w word characters, \s whitespace, . any character, * zero or more, + one or more, ? optional, ( ) capture group, [abc] character set, ^ start, $ end.

## Frequently asked questions
### Which regex flavor is this?

JavaScript. Patterns behave like new RegExp(pattern, flags) in the browser, which covers the vast majority of web use cases.

### Why is my pattern invalid?

Common causes: unbalanced parentheses or brackets, a trailing backslash, or an invalid flag. The error message names the problem.

### What are capture groups?

Parts of the pattern in parentheses. Each match reports what each group captured, which is how you extract pieces like the area code from a phone number.

### Is my text sent to a server?

No. Testing happens locally in your browser, so proprietary log data or code samples never leave your device.

---
Interactive version: https://toollantern.win/regex-tester/
