Test regular expressions with live match highlighting - flags, groups, capture display and a common pattern library.
Regular expressions (regex) are sequences of characters that define a search pattern, first formalised mathematically by Stephen Kleene in the 1950s and later popularised by the Unix tools grep and sed in the 1970s. Today, regex is a core skill for software developers, data analysts, and system administrators. In India, where the IT industry employs over 5 million professionals and generates exports exceeding $250 billion annually, regex knowledge is tested in technical screening rounds at companies like TCS, Wipro, Infosys, Flipkart, and Razorpay.
Indian developers use regex extensively for validating Aadhaar numbers (12-digit format), PAN card patterns (AAAAA1234A), Indian mobile numbers (10-digit starting with 6-9), GST registration numbers, and IFSC codes. Form validation, log parsing, data cleaning in Python Pandas, and web scraping scripts all depend on well-crafted regex patterns. Regex is also a syllabus topic in the GATE Computer Science exam and appears in competitive coding platforms like LeetCode and HackerRank used by lakhs of aspiring engineers.
This tool provides live match highlighting as you type, displays capture group contents separately, supports all standard JavaScript regex flags (global, case-insensitive, multiline, dotAll), and includes a library of common patterns to get started quickly. It runs entirely in your browser with no data sent to any server - making it safe for testing patterns against sensitive data during development.
^ and $ match start/end of each line; s (dotAll) - make the dot . match newline characters as well; u (unicode) - enable full Unicode matching including Devanagari, Tamil scripts and emoji. Combining flags (e.g., gi) is supported.() - they capture the matched text for later use. For example, the pattern (\d{4})-(\d{2})-(\d{2}) applied to "2024-01-15" captures three groups: Group 1 = "2024", Group 2 = "01", Group 3 = "15". Named groups use (?<name>...) syntax. In JavaScript, captured groups appear in match.groups. This tool displays all capture groups separately so you can inspect each one./^[6-9]\d{9}$/ - matches 10-digit numbers starting with 6, 7, 8 or 9. With country code: /^(\+91|0)?[6-9]\d{9}$/. PAN card: /^[A-Z]{5}[0-9]{4}[A-Z]{1}$/ - 5 uppercase letters, 4 digits, 1 uppercase letter. IFSC code: /^[A-Z]{4}0[A-Z0-9]{6}$/. Aadhaar: /^\d{12}$/ (format only - use Verhoeff checksum for full validation). GST number: /^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$/.*, +, ? match as much text as possible. For example, <.+> applied to <b>bold</b> matches the entire string (one match). Lazy matching - adding ? after a quantifier makes it match as little as possible: <.+?> applied to the same string matches <b> and </b> separately (two matches). Lazy matching is essential when extracting HTML tags, JSON values or delimited substrings.