Regex Tester
Test regular expressions online. Enter your regex pattern and test string to see matches highlighted in real-time.
Test regular expressions online. Enter your regex pattern and test string to see matches highlighted in real-time.
Regular expressions (regex) are pattern-matching sequences used for searching, validating, and transforming text. Mastering regex eliminates dozens of conditional string-checking functions with a single, concise pattern.
^[\w.-]+@[\w.-]+\.\w{2,}$\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b(?:\d{1,3}\.){3}\d{1,3}\bGreedy quantifiers (* + {}) match as many characters as possible. Lazy quantifiers (*? +? {}?) match as few as possible. Example: in "ab>cd>ef", the pattern <.*> (greedy) matches the entire string; <.*?> (lazy) matches only the shortest possible match. Use lazy matching when extracting specific delimited content.
Core syntax is mostly compatible, but flavor differences exist. JavaScript uses /pattern/flags syntax. Python's re module uses PCRE-like syntax. Always test regex in the specific language environment you'll deploy in — this tester uses JavaScript's regex engine.