Test regular expressions live.
The regex tester lets you build and try a regular expression against sample text and see every match instantly. It uses the JavaScript regular-expression engine, so what you see here matches how the pattern behaves in JavaScript code.
For each match it shows the matched text, its position in the string, and any captured groups — making it easy to develop and debug patterns for search, validation and extraction.
No. Enter only the pattern body, for example \d{3}-\d{4}. Choose the flags with the toggle buttons instead of writing them after a closing slash.
Turn on the g (global) flag. Without it, a regular expression matches just the first occurrence; with g the tester lists every match in the text.
m (multiline) changes ^ and $ to match at the start and end of each line, not just the whole string. s (dotall) makes the dot match newline characters too. They are independent.