Regex Tester
Learn and test regular expressions with plain-language tips, live highlights, and ready-made examples.
A regex is a search pattern for text. Write a pattern, paste sample text, then see what matches.
Quick start
- 1. Write a pattern — the rule to find (e.g. \d+ finds numbers).
- 2. Turn on flags if needed — usually g to find every match.
- 3. Paste Test text — the content you want to check.
- 4. Review the yellow highlights and the Matches list below.
Do not wrap with / /. Example: \d+ or hello.
/\b\w{4}\b/g
Matches are highlighted in yellow below.
test data with four word size like tool and code
- 1. test — at index 0
- 2. data — at index 5
- 3. with — at index 10
- 4. four — at index 15
- 5. word — at index 20
- 6. size — at index 25
- 7. like — at index 30
- 8. tool — at index 35
- 9. code — at index 44
.Any single character\dA digit 0-9\wLetter, digit, or _\sWhitespace\bWord boundary+One or more*Zero or more?Optional (0 or 1){n}Exactly n times[abc]One of a, b, or c^Start of text/line$End of text/lineHow to use
- 1
Read the short intro: a regex is a search pattern for text
- 2
Try an example button, or write your own pattern like \d+
- 3
Paste sample text and turn on flags (usually g)
- 4
Check yellow highlights and the matches list, then copy if needed
FAQ
What is a regex in simple words?
It is a mini language for describing text patterns. For example, \d+ means “one or more digits”.
What do Pattern, Flags, and Test text mean?
Pattern is the rule. Flags change how searching works (like case-insensitive). Test text is the content being searched.
Which flag should beginners use?
Start with g (global) so every match is shown. Add i if you want to ignore uppercase/lowercase.
Which regex engine is used?
JavaScript RegExp syntax, running fully in your browser.