Developer Tool
Regex Tester
Write a pattern, paste your test string, and see matches highlighted in real time. Toggle flags, inspect capture groups, and copy the final regex. No data leaves your browser.
Regular Expression
Valid//g
Flags
Press / to focus
Test String
122 chars ยท 3 lines
Match Preview
8matches
The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs. How vexingly quick daft zebras jump!
Match Details8 matches
Match 1
overindex 26..30Match 2
lazyindex 35..39Match 3
Packindex 45..49Match 4
withindex 57..61Match 5
fiveindex 62..66Match 6
jugsindex 80..84Match 7
daftindex 105..109Match 8
jumpindex 117..121Example Patterns
Quick Reference
Anchors
| ^ | Start of string / line |
| $ | End of string / line |
| \b | Word boundary |
| \B | Non-word boundary |
| \A | Start of string |
| \Z | End of string |
Character Classes
| . | Any char except newline |
| \d | Digit [0-9] |
| \D | Non-digit |
| \w | Word char [a-zA-Z0-9_] |
| \W | Non-word char |
| \s | Whitespace |
| \S | Non-whitespace |
| [abc] | Any of a, b, or c |
| [^abc] | Not a, b, or c |
| [a-z] | Character range |
Quantifiers
| * | 0 or more (greedy) |
| + | 1 or more (greedy) |
| ? | 0 or 1 (greedy) |
| {n} | Exactly n times |
| {n,} | n or more times |
| {n,m} | Between n and m |
| *? | 0 or more (lazy) |
| +? | 1 or more (lazy) |
| ?? | 0 or 1 (lazy) |
Groups & Lookaround
| (abc) | Capture group |
| (?:abc) | Non-capture group |
| (?<n>abc) | Named group n |
| | | Alternation (or) |
| (?=abc) | Lookahead |
| (?!abc) | Negative lookahead |
| (?<=abc) | Lookbehind |
| (?<!abc) | Neg. lookbehind |
Frequently asked questions
Is my regex pattern or test data sent to a server?
No. All regex matching runs entirely in your browser using JavaScript's native RegExp engine. Your pattern and test strings never leave your device and are not stored anywhere.
Why isn't my regex matching what I expect?
Common issues: forgetting the g flag when expecting multiple matches, case-sensitivity without the i flag, anchoring too tightly with ^ or $ so only full lines match, or special characters like . + * ? that are metacharacters, not literals, and need escaping with a backslash.
What regex flags does this tester support?
All standard JavaScript flags: g (global, find all matches), i (case-insensitive), m (multiline, ^ and $ match line boundaries), s (dotAll, . matches newlines), u (Unicode mode), and y (sticky, matches from lastIndex only). Toggle any combination using the flag buttons.
What is a capture group and how do I use it?
A capture group is part of a regex pattern enclosed in parentheses, e.g., (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string. The tester shows each group's matched value in the results panel. Named groups use the (?<name>pattern) syntax.
Can I test regex against multiline text?
Yes. Paste multiline text into the test string area. Use the m flag to make ^ and $ match the start and end of each line rather than the full string. Use the s flag if you need . to also match newline characters.
Related tools