Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Little machines that eat strings
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Penelope Phippen
August 02, 2016
Technology
130
1
Share
Little machines that eat strings
A talk about regular expressions and computer science presented at SF dot RB
Penelope Phippen
August 02, 2016
More Decks by Penelope Phippen
See All by Penelope Phippen
Introducing Rubyfmt
penelope_zone
0
610
How RSpec Works
penelope_zone
0
6.8k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
110
Teaching RSpec to play nice with Rails
penelope_zone
2
170
What is processor (brighton ruby edition)
penelope_zone
0
140
What is processor?
penelope_zone
1
380
extremely defensive coding - rubyconf edition
penelope_zone
0
290
Agile, etc.
penelope_zone
2
250
Extremely Defensive Coding
penelope_zone
0
130
Other Decks in Technology
See All in Technology
layerx-fde-practices
cipepser
6
2.2k
続 運用改善、不都合な真実 〜 物理制約のない運用改善はほとんど無価値 / 20260518-ssmjp-kaizen-no-value-without-physical-constraints
opelab
3
330
論文紹介:Pixal3D (SIGGRAPH 2026)
tenten0727
0
690
個人最適から組織最適へ — 仕組みで進めるAI推進
rfdnxbro
0
110
GCASアップデート(202603-202605)
techniczna
0
270
Splunk MCPサーバの利活用事例 ーKINTOテクノロジーズの取り組み
kintotechdev
1
190
情シスがMCP環境導入時に打ちのめされる認可の崖
oidfj
0
280
AIのために、AIを使った、Effect-TSからの脱却 〜テストを活用した安全なリファクタリングの進め方〜
bitkey
PRO
1
330
AsyncStreamでマルチブロードキャストを実装する
1mash0
1
210
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.7k
AWSアップデートから考える継続的な運用改善
toru_kubota
2
360
CloudFront VPCオリジンとVPC Latticeサービスの内部ALBをマルチアカウントで一元利用しよう
duelist2020jp
5
140
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
620
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
So, you think you're a good person
axbom
PRO
2
2k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Side Projects
sachag
455
43k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
89
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
220
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
510
Google's AI Overviews - The New Search
badams
0
1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Balancing Empowerment & Direction
lara
6
1.1k
Transcript
Little machines that eat strings
I am @samphippen on all the internets
Computer Science
I ❤❤ Computer Science
But not the way it’s taught
None
CS (mostly) won’t make you better at Rails
CS (mostly) won’t make you better at Node
CS (mostly) won’t make you better at Browsers
But it’s super interesting
It’s like art for programmers
I’m gonna teach you a little computer science
None
Regular Expressions
In Ruby
>> /wtf/
>> /wtf/ === "abc"
>> /wtf/ === "abc" => false
>> /wtf/ === "wtf" => true
>> /wtf/ === "hiwtf" => true
>> /wtf/ === "hiwtflol" => true
So how does it regex?
Let’s introduce a model
Let’s say we don’t speak english
Let’s say we have a different alphabet
There are only two characters
Regular Expressions
>> / / === “ ” => true
>> / / === “ ” => false
>> / / === “ ” => false
>> / / === “ ” => true
>> / / === “ ” => true
>> / / === “ ” => true
This implies regular expressions have state
Let’s introduce a model
Regular Expressions
None
Machines have a starting state
/ /
/ /
Regexp.new(“”)
Regexp.new(“”)
/ /
Remember earlier when I said they have state?
/ /
None
None
Starting state Accepting state
This is called a “deterministic finite automata”
This model of Regex was extremely helpful to my learning
It’s a different way of thinking about regular expressions
To me, that’s what CS is
A series of techniques for thinking about computer differently
Thanks @samphippen
[email protected]