Regex Tester

Test JavaScript regular expressions live — highlighted matches, capture groups and replace preview.

InstantPrivate — runs in your browserFree, no sign-up

Your details

Type the pattern without the surrounding / /.
Flags
Use $1, $2 or $<name> for groups.

Result

How to use

  1. 1

    Type your pattern and tick the flags you need.

  2. 2

    Paste some test text — matches are highlighted as you type.

  3. 3

    Check the capture groups table, and try a replacement.

Questions

Which regex flavour is this?

JavaScript (ECMAScript), as used in browsers and Node.js. Most syntax is shared with Python, Java and PCRE, but look-behind and named-group details can differ.

Why do I get only one match?

Without the g (global) flag a regex stops after the first match. Tick g to find all of them.

What does the s flag do?

It makes . also match line breaks. Without it, . matches any character except a new line.

About this Regex Tester tool

Regex Tester — Test JavaScript regular expressions live — highlighted matches, capture groups and replace preview. It is one of 200 free tools on namasivayam.in, made by software engineer Namasivayam Vadivelan for everyday use in India.

Everything is calculated instantly in your browser: nothing you type or upload is sent to any server, there is no sign-up, and it works on mobile and desktop. Type your pattern and tick the flags you need.

Related reading

Articles that go with this tool

All articles →

Related tools

More developer tools you may like

All 200 tools →

Results are estimates to help you plan. They are not financial, tax or medical advice.