Regex Tester
Test a regular expression against sample text, review the matches, and try a replacement before using it in code or a cleanup job. It is a safer place to tune a pattern than production data. It is free, needs no account, and adds no watermark to your result.
Loading text tools…
Working with other formats? Open your file workspace →
What people use it for.
What happens to your file.
The pattern and flags are passed to the JavaScript regular expression engine, then matches and replacements are calculated against the sample text. Errors are shown before anything runs.
Where it stops: JavaScript regex syntax is used, which differs from PCRE, Python, and .NET in some details. Very broad patterns can be slow on large text.
Everything you need, without a paywall.
Common questions.
Which regex flavor is this?
JavaScript regular expressions.
Can I test replacement text?
Yes. Add replacement text and inspect the transformed result.
Why did my pattern freeze elsewhere?
Some patterns backtrack heavily on long input. Test with realistic text before using them in a batch job.
You might also need.
Clean messy text by removing duplicate spaces, empty lines, HTML, invisible characters and unwanted formatting.
Remove duplicate lines and paragraphs instantly while preserving original order or sorting cleaned results.
Format and beautify JavaScript, TypeScript, HTML, CSS, SQL, Python, PHP, JSON and XML online.
Format, validate, beautify and minify JSON or convert JSON to XML, CSV and YAML using one online toolbox.