Escape from Planet Regex - Kotlin to the Rescue
summary
Covers concrete regex techniques and how Kotlin actually runs them: Kotlin’s Regex wraps Java Pattern, use raw strings (triple quotes) to avoid escaping, pass options like ignoreCase/multiline and use findAll instead of /g flag, inspect MatchResult where index 0 is the whole match and later entries are capture groups so matchResult groups destructure to captured values. Demonstrates lookarounds to solve an Advent of Code style puzzle (filter moles preceded by “do” but not “don’t”), shows working Kotlin code that extracts numbers, multiplies them, and parses salary/hour examples.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 5:56Understanding Regular Expressions Basics
- 9:34Special chars and wildcards
- 11:40Occurrence indicators
- 14:25Anchors and multi-line flag
- 16:12Character ranges
- 18:21Alternation and scoping
- 19:44Character classes
- 20:47Capture groups
- 24:20Reax in Kotlin
- 26:05Reax options
- 27:52Match results
- 28:57Salary calculation
- 30:25Advent of Code 1
- 31:28Lookaheads and lookbehinds
- 33:36Zero-width assertions
- 35:00Advent of Code 2
- 36:23Activating console
- 37:28Conclusion
related talks
38mEscape from Planet Regex - Kotlin to the Rescue
39mEscape from Planet Regex - Kotlin to the Rescue
38mEscape from Planet Regex - Kotlin to the Rescue
31mDesign Patterns with Kotlin
58mKotlin puzzlers, Vol. 2
51mKotlin Puzzlers, Vol 3
46mThe dark side of kotlin
17mEmbark on the Kotlin Adventure with Advent Of Code
