Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
110
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.7k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
96
Teaching RSpec to play nice with Rails
penelope_zone
2
150
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
110
Other Decks in Technology
See All in Technology
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
2k
re:Invent2025 3つの Frontier Agents を紹介 / introducing-3-frontier-agents
tomoki10
0
350
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.1k
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
190
フィッシュボウルのやり方 / How to do a fishbowl
pauli
2
350
さくらのクラウド開発ふりかえり2025
kazeburo
2
190
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
170
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
0
100
1人1サービス開発しているチームでのClaudeCodeの使い方
noayaoshiro
2
550
2025年 開発生産「可能」性向上報告 サイロ解消からチームが能動性を獲得するまで/ 20251216 Naoki Takahashi
shift_evolve
PRO
2
210
[Data & AI Summit '25 Fall] AIでデータ活用を進化させる!Google Cloudで作るデータ活用の未来
kirimaru
0
150
AWS re:Invent 2025~初参加の成果と学び~
kubomasataka
0
170
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Faster Mobile Websites
deanohume
310
31k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
24
Discover your Explorer Soul
emna__ayadi
2
1k
Marketing to machines
jonoalderson
1
4.3k
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]