Regex Tester
Test regular expressions with live match highlighting and group capture.
//g
Flags:
7 matches
Hello world! Testing 123 regex patterns here.
#1
Hello0–5Group 1:
Hello#2
world6–11Group 1:
world#3
Testing13–20Group 1:
Testing#4
12321–24Group 1:
123#5
regex25–30Group 1:
regex#6
patterns31–39Group 1:
patterns#7
here40–44Group 1:
hereJavaScript regex flags
| Flag | Name | Effect |
|---|---|---|
| g | Global | Find all matches, not just the first |
| i | Case insensitive | Match A and a as the same character |
| m | Multiline | ^ and $ match start/end of each line |
| s | Dot-all | . matches \n and \r as well |
| u | Unicode | Treat pattern and string as Unicode code points |
Frequently asked questions
Which regex engine does this use?
It uses your browser's native JavaScript RegExpengine — the same one used in Node.js and any JS runtime. Results are identical to what you'd get running the same regex in code.
How do I match a literal dot or parenthesis?
Escape special characters with a backslash. In the pattern field, \. matches a literal dot, \( a literal open parenthesis, and so on. The special characters that need escaping are: . * + ? ^ $ [ ] | ( ) { } \
What are capturing groups?
Parentheses in a pattern create capturing groups. For example, (\d+)-(\w+) has two groups. Each match shows the full match and then each group's value. Use (?:...) for a non-capturing group that groups without creating a capture.
