Test regular expressions in real time. Matches highlighted instantly, capture groups shown, flags support and a built-in pattern library.
A regular expression describes a pattern of text, such as an email address, a date, a log line or a URL. It is easy to get one wrong, because a small change can match far more or far less than you intended. This tester highlights every match as you type, shows capture groups and supports flags, so you can check a pattern against real examples before it goes into code.
^ and $ match at the start and end of each line, not only of the whole text.. match line breaks as well.\d{4} matches the first four digits of 123456. Use ^\d{4}$ to require exactly four digits.<.*> runs from the first < to the last > on the line. The lazy form <.*?> stops at the first one.example.com also matches examplexcom. Write example\.com.(a+)+ can freeze a program on certain input. Keep patterns simple, and never run patterns from untrusted users without a time limit.Browser-based testers use the JavaScript regex engine. PHP, Python and Java support most of the same syntax but differ in details such as lookbehind and named groups, so test the pattern again in your target language before you ship it.