~/talk

How I learned to stop worrying and love Regex

Talkat PHP UK Conference 2016 · 2016-02-18..02-19· [developer-experience]
slides:none on file

Covers concrete PHP regex mechanics: preg_match/PCRE behavior, greedy vs lazy vs possessive quantifiers, and anchors that bite (\$ vs \z). Shows a real composer use case that replaces token_get_all with staged regex filtering to avoid memory blowups, and demonstrates catastrophic backtracking turning millions of steps into ~20 by making repeats possessive. Notes PHP 7’s PCRE JIT speedup, recommends grep -E and the x modifier for readable, named groups, and gives practical limits for matching HTML or nested structures.

AI-written summary · about

  1. 0:00Intro
  2. 1:07History
  3. 4:08Regex Concepts
  4. 4:30Pattern Components
  5. 5:10Character Classes
  6. 7:40Character Class Shortcuts
  7. 8:52Dot Metacharacter
  8. 9:49Subpatterns and Alternations
  9. 14:25Lazy Quantifiers
  10. 15:58Possessive Quantifiers
  11. 18:35Anchors for Validation
  12. 20:19Back-references to Subpatterns
  13. 21:54Lookahead & Lookbehind
  14. 24:12Word boundary metacharacter
  15. 25:29Conditionals
  16. 25:59Pattern Delimiters
  17. 27:50Modifiers
  18. 28:47Readability
  19. 33:00Engine Properties
  20. 39:04PCRE JIT
  21. 40:24Code Search
  22. 43:04Stripping Remove a prefix if it's present
  23. 43:48Stripping PHP files to bits
  24. 46:50Splitting
  25. 47:17grep
  26. 48:08Does it match?
  27. 50:03Limitations
  28. 51:07Domain
  29. 52:45Boundaries
  30. 53:17Document
~/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.