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
95
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
スタートアップ1人目QAエンジニアが QAチームを立ち上げ、“個”からチーム、 そして“組織”に成長するまで / How to set up QA team at reiwatravel
mii3king
2
1.4k
RECRUIT TECH CONFERENCE 2025 プレイベント【高橋】
recruitengineers
PRO
0
150
Helm , Kustomize に代わる !? 次世代 k8s パッケージマネージャー Glasskube 入門 / glasskube-entry
parupappa2929
0
250
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
1
670
技術負債の「予兆検知」と「状況異変」のススメ / Technology Dept
i35_267
1
1.1k
エンジニアの育成を支える爆速フィードバック文化
sansantech
PRO
3
1k
滅・サービスクラス🔥 / Destruction Service Class
sinsoku
6
1.6k
組織貢献をするフリーランスエンジニアという生き方
n_takehata
1
1.3k
The Future of SEO: The Impact of AI on Search
badams
0
180
Datadogとともにオブザーバビリティを布教しよう
mego2221
0
140
30分でわかる『アジャイルデータモデリング』
hanon52_
9
2.6k
Classmethod AI Talks(CATs) #16 司会進行スライド(2025.02.12) / classmethod-ai-talks-aka-cats_moderator-slides_vol16_2025-02-12
shinyaa31
0
100
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Being A Developer After 40
akosma
89
590k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
How STYLIGHT went responsive
nonsquared
98
5.4k
Facilitating Awesome Meetings
lara
51
6.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
9
440
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
4 Signs Your Business is Dying
shpigford
182
22k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
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]