developerTools
How to Test Regular Expressions in the Browser
Use the Regex Tester to try a pattern against sample text, change flags, inspect matches and capture groups, and copy generated code.
Open the Regex Tester, enter a pattern, and add the text you want to test. The tool evaluates the pattern with the browser's native RegExp implementation and reports syntax errors when the pattern cannot be compiled.
Use the flag controls to change how the expression runs. The tool supports the g, i, m, s, u, and y flags, and includes preset patterns for common inputs such as email addresses, URLs, IP addresses, phone numbers, and passwords. The match panel shows the matched text, capture groups, named groups when present, and match positions when the browser supports match indices.
When the pattern is ready, copy the expression or switch the code output between JavaScript, Python, Go, and PHP snippets. Generated snippets are starting points: test them in the target runtime before relying on them in an application.