~/talk

Build your own Swift Regex: A Gentle Introduction to Swift Regex

Talkat try! Swift Tokyo 2025 · 2025-04-09..04-11· [swift, developer-experience]
slides:none on file

Swift regex engine still lacks features like lookbehind and is hard to change, so this session implements concatenation alternation repetition in a tiny Swift engine that compiles a recursive‑descent AST to bytecode and runs a VM‑based backtracker. The uploader’s repo contains the actual Swift code on GitHub repo, the demo shows step‑by‑step execution, and performance notes quantify backtracking differences (e.g. 32 vs 14 steps, 10 vs 2 backtracks) and a 5x speedup for a non‑backtracking pattern.

AI-written summary · about

  1. 0:00Introduction to regex
  2. 1:34Three fundamental operations
  3. 4:46Parsing and architecture
  4. 7:01Compiling to bytecode
  5. 8:07Matching and backtracking
  6. 13:56Implementing repetition
  7. 16:36Writing efficient regex
  8. 19:23Conclusion and resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.