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
Penelope Phippen
August 02, 2016
Technology
1
120
Little machines that eat strings
A talk about regular expressions and computer science presented at SF dot RB
Penelope Phippen
August 02, 2016
Tweet
Share
More Decks by Penelope Phippen
See All by Penelope Phippen
Introducing Rubyfmt
penelope_zone
0
590
How RSpec Works
penelope_zone
0
6.8k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
98
Teaching RSpec to play nice with Rails
penelope_zone
2
160
What is processor (brighton ruby edition)
penelope_zone
0
130
What is processor?
penelope_zone
1
370
extremely defensive coding - rubyconf edition
penelope_zone
0
280
Agile, etc.
penelope_zone
2
240
Extremely Defensive Coding
penelope_zone
0
120
Other Decks in Technology
See All in Technology
サラリーマンソフトウェアエンジニアのキャリア
yuheinakasaka
42
20k
スクラムを一度諦めたチームにアジャイルコーチが入ってどう変化したか / A Team's Second Try at Scrum with an Agile Coach
kaonavi
0
280
旬のブリと旬の技術で楽しむ AI エージェント設計開発レシピ
chack411
1
300
それぞれのペースでやっていく Bet AI / Bet AI at Your Own Pace
yuyatakeyama
1
420
Exadata Database Service ソフトウェアのアップデートとアップグレードの概要
oracle4engineer
PRO
1
1.2k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.9k
なぜCREを8年間続けているのか / cre-camp-4-2026-01-21
missasan
0
1k
ソフトとハード両方いけるデータ人材の育て方
waiwai2111
1
540
kintone開発のプラットフォームエンジニアの紹介
cybozuinsideout
PRO
0
560
Introduction to Bill One Development Engineer
sansan33
PRO
0
350
Hardware/Software Co-design: Motivations and reflections with respect to security
bcantrill
1
230
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
97
6.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
100
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Designing for Timeless Needs
cassininazir
0
120
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
43
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
220
[SF Ruby Conf 2025] Rails X
palkan
0
720
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
230
How to Ace a Technical Interview
jacobian
281
24k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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]