Skip to main content
ConduitTools by ConduitCode Labs

Developer

Regex Tester

Write a regular expression, paste some text, and see every match highlighted with its position and capture groups. Try a replacement and copy the pattern as code.

  • Free
  • No sign-up
  • Runs in your browser
Waiting for a pattern
Pattern and textWrite an expression, then paste the text to test it on
Start from an example
MatchesHighlighted as you type, with every group

Enter a pattern and the matches appear here, highlighted in your text.

Matches
Capture groups
Flags
Match time
What it handles

See exactly what your pattern does.

A regular expression is easy to get almost right. Seeing each match, and each group inside it, shows where a pattern is too greedy or too strict.

Live highlighting

Every match is marked in your text as you type, with its position, line and column listed underneath. Neighbouring matches alternate colors so you can tell where one ends.

Groups and replacement

Capture groups and named groups are listed for each match. Turn on replace to preview the result with $1, $<name> and $& before you use it in code.

Safe against runaway patterns

Matching runs in the background and is stopped after a moment, so a pattern with catastrophic backtracking gives you a warning instead of freezing the tab.

Frequently asked questions

Which regex flavor does this use?

JavaScript's, the same engine your browser and Node.js use. Most syntax is shared with other languages, but a few things differ: named groups are written (?<name>...) rather than (?P<name>...), and there are no possessive quantifiers or atomic groups.

What do the flags do?

Global finds every match instead of just the first. Ignore case treats upper and lower case as equal. Multiline makes ^ and $ match at each line. Dot matches newline lets . cross line breaks. Unicode turns on full Unicode handling, including \u{1F600} escapes.

Why does it say my pattern is taking too long?

Some patterns, such as (a+)+$ on a long run of a's, make the engine try an exponential number of paths. That is called catastrophic backtracking. Make the pattern more specific, or avoid repeating a group that can already match the same text in several ways.

How do I use a group in the replacement?

Write $1, $2 and so on for numbered groups, $<name> for a named group, and $& for the whole match. Use $$ for a literal dollar sign.

Keyboard shortcuts

CtrlK
Search all tools
/
Search the directory (on the homepage)
CtrlEnter
Copy or download the result
CtrlShiftEnter
Generate a new password or new text
?
Show this list
Esc
Close a dialog or menu