Regex Tester
Test JavaScript regular expressions live, with match highlighting, capture groups and a plain-English breakdown.
NewmediumRuns in your browser
How it works
A regular expression is a compact pattern for matching text. This tester uses your browser’s own JavaScript RegExp engine, so results match what you would get in JS and TypeScript. Other languages (Python, Java, PCRE) differ in some details such as lookbehind and named-group syntax.
- Flags change behaviour:
gfinds every match,iignores case,mmakes ^ and $ line-aware,slets . match newlines. - Groups
( )capture text;(?<name>…)gives the capture a name;(?:…)groups without capturing. - Quantifiers are greedy by default (take as much as possible). Add
?to make them lazy. - Lookarounds check what is before or after without consuming it.
- Matching runs in a background worker with a 1.5-second limit. Patterns with nested quantifiers such as
(a+)+$can take exponential time on some inputs (ReDoS); the tester stops them instead of freezing the page.
Related tools
CodeNew
Syntax Compare
20 languages side by side, from hello world to concurrency and GPU kernels: Python, C++, Rust, CUDA, Triton, WGSL and more.
CodeNew
Git Command Finder
Find the right git command by describing what you want to do, with danger warnings.
CodeNew
Big-O Cheat Sheet
Time and space complexity of data structures, sorting and graph algorithms, colour-coded and filterable.