~/talk

Two Problems: Regular Expressions for Revolutionaries

Talkat JSConf EU 2017 · on Sunday, 2017-05-07· [javascript, frontend-architecture]
slides:none on file

Regular expressions predate computers and are mathematically equivalent to finite-state machines, so they have no stack and therefore can't parse HTML reliably; JavaScript’s regex engine borrows Perl features like lookaheads that push it beyond pure regular languages. Examples: subway turnstiles modeled as states, a Lego Turing machine demonstration, and the implementation note to prefer the RegExp constructor for dynamic patterns. Conclusion: use regexes for shallow pattern matching, switch to grammars or parsers when nested structure matters.

AI-written summary · about

  1. 0:00Introduction
  2. 1:11Why regular expressions can be problematic
  3. 3:52Whitespace in JavaScript
  4. 7:05Origins and basics of regular expressions
  5. 8:35Regex in Chomsky hierarchy
  6. 10:57Turing machines and regex
  7. 12:46Finite-state automata
  8. 13:52Why HTML cannot be parsed with regular expressions
  9. 15:16Perl's regex influence
  10. 17:09Regex strengths and limits
  11. 18:43Human language parsing
  12. 19:03Declaring regular expressions in JavaScript
  13. 19:55Regex applications and future
~/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.