Skip to content
TrySitePrice

Regex tester

Write a pattern, pick its flags, and see every match highlighted in place with its capture groups listed. The engine is your browser's own, so what matches here matches in your JavaScript.

Written without the surrounding slashes. Your browser's own RegExp engine evaluates it, so what matches here matches in your JavaScript.

Flags

Uses String.replace, so $1, $<name> and $& behave exactly as they do in JavaScript.

Matches

5

The Robots Exclusion Protocol is published as RFC 9309. Google documents crawl-delay as unsupported.

at 0 The

at 4 Robots

at 11 Exclusion

at 21 Protocol

at 56 Google

Pattern facts

Expression
/\b[A-Z][a-z]+\b/g
Capture groupsCounted from the first match
0
Characters matched
32 of 100
Matching stops at 200 results, and a zero-width match is advanced by one character so a pattern like a* cannot loop forever. Both limits are stated because a tester that hangs your tab is worse than one that says it stopped early.

Questions about regular expressions

01Why does my pattern match once when I expected many?

Because the g flag is off. Without it, RegExp stops at the first match — which is also why a pattern tested in one tool and run in another can behave differently: the flags, not the pattern, are the difference. The flags in use are shown as part of the expression above.

02What is a zero-width match?

A match of nothing, which patterns like a* or \\b produce. They are real matches and they are shown here with a placeholder so they are visible, and the scan is advanced by one character after each so a zero-width pattern cannot loop forever. Both the cap and the advance are stated because a tester that freezes your tab is worse than one that admits it stopped.

03Will this work for my Python or PCRE pattern?

Mostly, and the exceptions bite. JavaScript has no inline comments, no possessive quantifiers, no atomic grouping and no recursion. Lookbehind is a separate question and a dated one: it was unevenly supported when it was new, and this page does not assert a current browser-support position because none was checked — if a lookbehind matters to you, test it in the browser you target. Treat this as a JavaScript tester specifically — that is the honest scope of a tool running in a browser.

04How do I use a capture group in the replacement?

The same way String.replace does: $1 for the first group, $<name> for a named one, $& for the whole match. The preview shown is literally the result of String.replace, so what you see is what your code will produce.

Related checks

Patterns often end up in a robots.txt path or a redirect rule — check the first against the robots.txt tester, and validate JSON you are extracting with the JSON formatter.