Test regex patterns with live highlighting. Generate code for JS, Python, PHP.
Select a language above
Regular expressions (regex) are patterns that describe sets of strings. They are used in virtually every programming language for searching, matching, and replacing text. A regex like \w+@\w+\.\w+ matches email addresses by specifying the pattern of characters before and after the @ symbol.
The global flag (g) finds all matches instead of stopping at the first one. Case-insensitive (i) ignores uppercase/lowercase differences. Multiline (m) makes ^ and $ match line boundaries instead of string boundaries. Dotall (s) makes the dot character match newlines.
Unlike regex101.com, this tool processes all patterns and test strings entirely in your browser. No data is sent to any server, making it safe to test regex patterns against sensitive data like API keys, personal information, or proprietary content.
Email validation: [\w.+-]+@[\w-]+\.[\w.]+. URL matching: https?://[\w.-]+(/[\w.-]*)*. Phone numbers: \+?\d{1,3}[-.\s]?\d{3,4}[-.\s]?\d{4}. IP addresses: \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}. Dates: \d{4}-\d{2}-\d{2}. This tool lets you test any pattern against your own data instantly.
The g (global) flag finds all matches instead of stopping at the first. The i (case-insensitive) flag ignores uppercase/lowercase. The m (multiline) flag makes ^ and $ match line boundaries. The s (dotall) flag makes the dot match newlines. Toggle these flags in the pattern bar above.
ToolPry runs entirely in your browser — no data is sent to any server. On regex101, your patterns and test strings are processed on their servers and may be stored. If you are testing patterns against sensitive data like API keys, passwords, or personal information, ToolPry is the safer choice.
Yes. After testing your pattern, click JavaScript, Python, or PHP to generate ready-to-use code snippets. The generated code includes the correct syntax for each language with your pattern and flags already applied.