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
91
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
550
How RSpec Works
penelope_zone
0
6.5k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
80
Teaching RSpec to play nice with Rails
penelope_zone
2
130
What is processor (brighton ruby edition)
penelope_zone
0
100
What is processor?
penelope_zone
1
350
extremely defensive coding - rubyconf edition
penelope_zone
0
250
Agile, etc.
penelope_zone
2
220
Extremely Defensive Coding
penelope_zone
0
92
Other Decks in Technology
See All in Technology
グループ ポリシー再確認 (2)
murachiakira
0
210
Oracle Cloud Infrastructure:2025年4月度サービス・アップデート
oracle4engineer
PRO
0
320
更新系と状態
uhyo
8
2.2k
勝手に!深堀り!Cloud Run worker pools / Deep dive Cloud Run worker pools
iselegant
4
620
今日からはじめるプラットフォームエンジニアリング
jacopen
8
1.9k
AIとSREで「今」できること
honmarkhunt
3
680
クラウド開発環境Cloud Workstationsの紹介
yunosukey
0
220
PostgreSQL Log File Mastery: Optimizing Database Performance Through Advanced Log Analysis
shiviyer007
PRO
1
150
読んで学ぶ Amplify Gen2 / Amplify と CDK の関係を紐解く #jawsug_tokyo
tacck
PRO
1
290
Dynamic Reteaming And Self Organization
miholovesq
3
730
2025-04-24 "Manga AI Understanding & Localization" Furukawa Arata (CyberAgent, Inc)
ornew
2
320
AIにおけるソフトウェアテスト_ver1.00
fumisuke
1
330
Featured
See All Featured
Faster Mobile Websites
deanohume
306
31k
It's Worth the Effort
3n
184
28k
Adopting Sorbet at Scale
ufuk
76
9.3k
The Cost Of JavaScript in 2023
addyosmani
49
7.8k
Being A Developer After 40
akosma
91
590k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
KATA
mclloyd
29
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
105
19k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
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 sphippen@do.co