🔍 Regex Tester
Test regular expressions in real-time. See matches highlighted, capture groups, and match details.
Quick Reference
📖 Regular Expressions Guide
Regular expressions (regex) are powerful patterns for matching, searching, and manipulating text. They are supported in virtually every programming language (JavaScript, Python, Java, PHP, etc.) and are essential for data validation, text parsing, search-and-replace, and web scraping.
A regex pattern consists of literal characters and metacharacters. For example, \d+ matches one or more digits, [A-Za-z]+ matches words, and ^.+@.+\.\w{2,}$ is a basic email pattern. Mastering regex can save hours of manual text processing.
❓ Frequently Asked Questions
.* is greedy — it matches as many characters as possible. .*? is lazy — it matches as few characters as possible. In the string "abc123def", a.*d matches "abc123d" (greedy), while a.*?d would also match "abc123d" but prefers the shortest match when multiple are possible.
Escape them with a backslash: \. matches a literal dot, \( matches a parenthesis, \\ matches a backslash. Characters that need escaping: . * + ? ^ $ { } [ ] ( ) | \ /