Regex Tester
Write a pattern, paste sample text and see every match highlighted with its groups. Try a replacement string before using it in code. Uses the same regex engine as your browser’s JavaScript.
Runs entirely in your browser. Your input and files are not uploaded to any server.
How to use
- Enter a pattern without slashes, and choose flags.
- Paste the test text. Matches are highlighted as you type.
- Inspect the match table for positions and capture groups.
- Optionally enter a replacement (use $1, $<name>) to preview the result.
Examples
Pattern [\w.+-]+@[\w-]+\.[\w.]+ with flag g.
(?<y>\d{4})-(?<m>\d{2})-(?<d>\d{2}) and replacement $<d>/$<m>/$<y>.
Privacy
Your files and text stay in your browser while you use this tool, and ads or anonymous visit statistics do not receive them. Only your favorites and recent tools are saved on your device. Privacy policy
Want proof? Check it with your browser’s Network tab: How to check that a tool does not upload your files
Frequently asked questions
Which regex flavour is this?
ECMAScript (JavaScript) as implemented by your browser. PCRE, Python and .NET have differences, such as possessive quantifiers and some lookbehind rules.
Can a bad pattern freeze the page?
Patterns with catastrophic backtracking can be slow. The tool limits the number of matches shown and the text length; if a pattern is very slow, simplify nested quantifiers like (a+)+.