Escape from Planet Regex - Kotlin to the Rescue
summary
Crash-landing narrative hides a practical teardown of regular expressions implemented with Kotlin’s Regex class: using Regex class or the string extension, prefer raw strings to avoid double-escaping, pass RegexOption flags (IGNORE_CASE, MULTILINE) and call find/findAll/matches/split/replace rather than a global flag. Demonstrations show MatchResult.group indexing (0 = whole match, 1+ = capture groups), lookarounds for Advent of Code day 3 logic, and a working Kotlin solution that extracts and multiplies the captured numbers.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 3:07Regex basics
- 7:16Literal chars and wildcards
- 10:23Special chars and escaping
- 11:05Occurrence indicators
- 13:32Greedy vs lazy matching
- 13:53Anchors and flags
- 15:38Character sets and ranges
- 17:05Negated sets and alternation
- 18:47Character classes and groups
- 23:04Kotlin Regex class
- 24:47Kotlin match functions
- 25:51Match results in Kotlin
- 26:55Practical Kotlin example
- 28:40Advent of Code with Regex
- 29:44Lookarounds explained
- 33:13Lookbehinds limitations
- 33:56Advent of Code part two
- 35:44Conclusion and Q&A








