// live match highlighting · capture groups · flags · common patterns · javascript regex engine
A regex tester lets you write and debug regular expressions against sample text in real time. It shows you exactly which parts of your string match, highlights capture groups, and tells you match positions — saving hours of trial-and-error in your code editor.
This tool uses JavaScript's native RegExp engine, so results are accurate for JS applications, Node.js backends, and browser-side validation.
g global, i case-insensitive, m multiline, s dotAllg (global) flag makes the regex find all matches in the string, not just the first one. Without it, the regex stops after the first match. Almost always enable this when testing — without g you'll only see match #1.(\d{4})-(\d{2})-(\d{2}) matches a date and captures year, month, and day as separate groups. Named groups use the syntax (?<year>\d{4}).. matches any character except a newline (unless the s flag is set). \s matches any whitespace character: space, tab, newline, carriage return, form feed. Use \s+ to match one or more whitespace characters.* and + are greedy by default — they match as much as possible. Add ? after them to make them lazy (match as little as possible): .*? instead of .*. Also use anchors ^ and $ to restrict matches to the start/end of the string or line.\. matches a literal dot. \( matches a literal opening parenthesis. Special characters that need escaping: . * + ? ^ $ { } [ ] | ( ) \