Regular Expressions, To Match Or Not, That is the Question
summary
Covers reading and building real regexes with practical claims: the TWiki engine uses 200 regex in Perl to turn its markup into HTML, a common email validator (simple, then RFC-compliant) and a backreference pattern that matches opening and closing tags, plus a two-pass regex trick to handle nested parentheses. Demonstrates greedy vs lazy matches, lookarounds and non-capturing groups, and measures: 10K-line CSV parse ~50 ms from disk, ~3.5 ms in memory, while ColdFusion regex is much slower. Uses Perl and online visualizers for debugging.
AI-written summary · about
chapters (16)
- 0:00Introduction and setup
- 4:43What are regular expressions
- 8:48Basic regex syntax
- 17:46Anchors and boundaries
- 23:26Repetition and quantifiers
- 28:12Greedy vs non-greedy matching
- 31:03Grouping and backreferences
- 36:23Validating email addresses
- 41:00RFC compliance and accuracy
- 43:29Regex vs procedural programming
- 44:57Regex modifiers and performance
- 46:25Lookahead and lookbehind
- 48:19Logical AND in regex
- 51:10Backreferences explained
- 54:51Regex for nested structures
- 57:28Q&A and resources
