RegEx Tester
Test regular expressions against text with real-time matching and group capture.
Runs entirely in your browser.
Regular Expression Testing Tool
/
/
Anna and Ben are learning JavaScript at W3Schools. They practice every Monday.
6 matches found
| # | Match | Index | Length |
|---|---|---|---|
| 1 | Anna | 0 | 4 |
| 2 | Ben | 9 | 3 |
| 3 | JavaScript | 26 | 10 |
| 4 | W3Schools | 40 | 9 |
| 5 | They | 51 | 4 |
| 6 | Monday | 71 | 6 |
Quick Reference
| Pattern | Description |
|---|---|
. | Any character except newline |
\d | Digit (0-9) |
\w | Word character (a-z, A-Z, 0-9, _) |
\s | Whitespace |
[abc] | Character class |
^ / $ | Start / end of line |
* / + / ? | 0+, 1+, 0 or 1 |
{n,m} | Between n and m times |
(group) | Capture group |
(?:group) | Non-capturing group |
a|b | Alternation (a or b) |
About Regular Expressions
Regular Expressions are a powerful tool for pattern matching and text manipulation.
They are used in many programming languages and tools to search, replace, and validate text.
Learn more: JavaScript RegExp Reference