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
84
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
540
How RSpec Works
penelope_zone
0
6.5k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
77
Teaching RSpec to play nice with Rails
penelope_zone
2
120
What is processor (brighton ruby edition)
penelope_zone
0
94
What is processor?
penelope_zone
1
340
extremely defensive coding - rubyconf edition
penelope_zone
0
250
Agile, etc.
penelope_zone
2
210
Extremely Defensive Coding
penelope_zone
0
89
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
6
54k
商品レコメンドでのexplicit negative feedbackの活用
alpicola
2
370
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
290
.NET AspireでAzure Functionsやクラウドリソースを統合する
tsubakimoto_s
0
190
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.5k
Docker Desktop で Docker を始めよう
zembutsu
PRO
0
170
Accessibility Inspectorを活用した アプリのアクセシビリティ向上方法
hinakko
0
180
2025年のARグラスの潮流
kotauchisunsun
0
800
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
Formal Development of Operating Systems in Rust
riru
1
420
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
180
DMMブックスへのTipKit導入
ttyi2
1
110
Featured
See All Featured
A designer walks into a library…
pauljervisheath
205
24k
Designing for Performance
lara
604
68k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
960
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7.1k
Scaling GitHub
holman
459
140k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
GraphQLとの向き合い方2022年版
quramy
44
13k
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]