Home › Tools › JavaScript › Regex Tester

Regex Tester

Test regular expressions and list every match with index. Free, private and instant.

About the Regex Tester

A regular expression describes a text pattern. Testing it against sample text shows every match and its position before you put it in code.

When to use it

Use it to build validation rules, extract values from logs, or fix a pattern that matches too much or too little.

Reading a pattern

Literal characters match themselves. \d matches a digit, \w a word character and \s whitespace. Quantifiers like +, * and {n} say how many times to repeat, and parentheses create groups.

Flags

The g flag finds every match instead of the first, i ignores case, m makes ^ and $ work on each line, and s lets the dot match new lines. This tester always runs globally so you can see all matches.

Common pitfalls

Greedy quantifiers such as .* match as much as possible, so use .*? to match as little as possible. Characters like . ? and ( must be escaped with a backslash to match literally. Poorly written patterns can also run slowly on long input.

Testing strategy

Try both matching and non-matching samples, include edge cases like empty strings, and keep patterns as simple as you can. For things like emails and URLs, use a real parser when accuracy matters.

How to use the Regex Tester

  1. Enter or paste your input in the fields above.
  2. The result updates as you type, or press Run.
  3. Press Copy to copy the output.

Frequently asked questions

Is the Regex Tester free?

Yes. It is completely free, with no signup and no usage limits.

Is my data uploaded anywhere?

No. Everything runs locally in your browser, so what you type never leaves your device.

Does the Regex Tester work on mobile?

Yes. The tool is responsive and works on phones, tablets and desktops.

More free tools

{}JSON Formatter & Validator

Format, minify and validate JSON instantly.

JavaScript
{}JSON to CSV Converter

Convert a JSON array of objects into CSV with proper quoting.

JavaScript
{}JSON Key Sorter

Sort JSON object keys alphabetically, including nested objects.

JavaScript
{}JavaScript String Escape / Unescape

Escape text for safe use in JavaScript strings, or unescape it.

JavaScript
{}JavaScript Date Formatter

Convert any date into ISO, UTC, local and Unix formats.

JavaScript
AaBase64 Encoder / Decoder

Encode or decode Base64 with full UTF-8 support.

Utilities
Copied!