Regex Mentor
100% in your browser · data never leaves your device
Write, test and understand regular expressions — highlighted matches, groups and a cheatsheet, all evaluated locally in your browser. The paid API endpoint for agents is at POST /api/regex-mentor.
/
/
Highlighted text
Matches 0
Cheatsheet
.any char except newline\d \Ddigit / non-digit\w \Wword char / non-word\s \Swhitespace / non-whitespace\b \Bword boundary / not a boundary^ $start / end of line (with m)[abc] [^abc]char set / negated set[a-z]range* + ?0+ / 1+ / 0 or 1{2} {2,} {2,5}exact / min / range*? +?lazy (non-greedy)(abc)capturing group(?:abc)non-capturing group(?<name>abc)named groupa|balternation(?=abc) (?!abc)lookahead / negative(?<=abc) (?<!abc)lookbehind / negative\1 $1backreference / replacementg i m s u yglobal, ignore case, multiline, dotAll, unicode, stickyHow to use
- Type a regular expression and a sample text.
- See matches highlighted live, with named and numbered groups.
- Open the cheatsheet for syntax hints.
- Copy the pattern or the match list when done.
Where it applies
- Writing a validation pattern with instant feedback.
- Explaining an inherited regex you do not fully understand.
- Extracting groups from log lines.
- Agents matching text via the paid <code>POST /api/regex-mentor</code> endpoint.