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
Runs entirely in your browser. Your input and files are not uploaded to any server. See the privacy policy for what is stored in your browser (favorites and history only). Privacy policy
Check it yourself: open your browser’s developer tools, select the Network tab and use the tool. Your file never appears in an upload request. Once this page is saved for offline use, you can also disconnect from the internet and keep working. Ads and anonymous visit statistics, when enabled, make their own requests, but they never receive your files or text.
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+)+.