Skip to content
πŸ”

Regex Tester

Developer

Free JavaScript regex tester against sample text - toggle flags, inspect highlighted matches, and read numbered or named capture groups (enter the pattern without surrounding slashes).

0
0
Pattern0 matches
//g
Pattern token reference

Token hints are not a complete semantic explanation of nested expressions.

\b A word boundary

\w A word character (letter, digit, or underscore)

+ One or more of the preceding token

@ A literal "@" character

\w A word character (letter, digit, or underscore)

+ One or more of the preceding token

\. A literal "." character (escaped)

\w A word character (letter, digit, or underscore)

+ One or more of the preceding token

\b A word boundary

Test string
Highlighted

JavaScript RegExp tester for one pattern and one test string (2,000 / 50,000 chars, 1,000 matches, 500 ms timeout). No Python/PCRE switch and no replace box.

See more about the Regex Tester

Examples

Find order numbers

Pattern: \d+
Flags: g
Text: Order 12 costs 34
Matches: 12 at index 6; 34 at index 15

JavaScript RegExp only - not Python or PCRE. Limits: 2,000 pattern chars, 50,000 test chars, 1,000 matches, 500 ms worker timeout. The detailed list shows the first 100 matches.

Named groups for a slug

Pattern: (?<kind>blog|docs)/(?<slug>[a-z0-9-]+)
Flags: g
Text: /blog/hello-world
Groups: kind=blog, slug=hello-world

This page tests matches; it does not run replace. For lookahead/lookbehind walkthroughs, open the related tutorial on the page.

Key features

  • JavaScript flags and highlights
  • Match offsets and capture groups
  • No upload, runs locally

Quick answers for Regex Tester

Which regex syntax does it use?
JavaScript regular expressions. Enter a pattern without surrounding slashes and choose flags using the controls.
What are the limits?
2,000 pattern characters, 50,000 test characters and 1,000 matches. A worker stops after 500 ms. The detailed list shows the first 100 matches.
Can I inspect capture groups?
Yes. The result lists match offsets and numbered or named capture groups. This page tests matches; it does not replace text.
Does my pattern or sample leave the browser?
No. Matching runs in a local worker. There is no Python or PCRE mode on this page.