Regular Expression Tester
Test JavaScript regular expressions online and inspect matches and capture groups.
0 chars
Your text is processed only in this browser.
Enter a regular expression and test text to see matches and capture groups.
Enter text to update the result automatically.
Common regular expression rules
| Syntax | Meaning |
|---|---|
| \d / \D | Digits [0-9]; uppercase D matches non-digits. |
| \s / \S | Whitespace, including spaces, tabs and line breaks; uppercase S matches non-whitespace. |
| \w / \W | ASCII letters, digits or underscore [A-Za-z0-9_]; uppercase W matches other characters. |
| . | Any character except line breaks; the s flag also includes line breaks. |
| ^ / $ | Start or end of text; with the m flag, start or end of each line. |
| * / + / ? | Repeat the preceding item zero or more times, one or more times, or zero or one time. |
| {n,m} | Repeat the preceding item n to m times; {n} means exactly n times. |
| [abc] / [^abc] | Any character in the set; a leading ^ excludes those characters. |
| (...) / | | Parentheses capture a group; the vertical bar matches either alternative. |
Online JavaScript regular expression tester
Enter a regular expression and test text to inspect matches and capture groups. This tool uses the browser’s JavaScript RegExp syntax and is useful for frontend development and quick checks of common patterns.
Which regular expression syntax does this tool support?
It uses the current browser’s JavaScript RegExp syntax, including standard flags and capture groups. Other regex engines may differ in escaping, lookarounds, and other features.