Regex tester
Type a pattern and a text - matches highlight as you type, and below you see every group and the replace result.
g Replace
Everything happens in your browser - nothing you type here is sent to any server.
How it works
How to use the tester
Type the pattern without slashes and tick the flags beside it - “g” finds all matches, not just the first. The tester uses the JavaScript engine, the same as in browsers and Node.js. In the replacement you can refer to groups: $1, $2, or $<name> for named groups.
Patterns check the format, not validity
Patterns for phones, postcodes or tax IDs check the shape of the text, not whether it's real - a tax ID also has a check digit a regular expression can't compute. In form validation, treat them as a first filter.
Frequently asked questions
Will this regex work in PHP or Python?
The basics, yes, but engines differ - e.g. named groups in Python are written (?P<name>…). The tester shows how JavaScript behaves.
What is catastrophic backtracking?
Patterns like (a+)+ can take exponentially long on some texts and freeze a page or a server. The tester stops such a pattern after a second and a half.
Is my text sent anywhere?
No, everything happens in your browser.
More tools
- Website checker
- Google search preview
- UTM link builder
- QR code generator
- Character counter
- Email signature generator
- Image compressor
- Favicon generator
- Colour contrast checker
- Text compare
- JSON formatter
- Base64 encode and decode
- JWT decoder
- Timestamp converter
- URL encode / decode
- UUID generator
- Hash generator (SHA-256, MD5)
- Cron expressions