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
99
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
560
How RSpec Works
penelope_zone
0
6.6k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
82
Teaching RSpec to play nice with Rails
penelope_zone
2
140
What is processor (brighton ruby edition)
penelope_zone
0
110
What is processor?
penelope_zone
1
350
extremely defensive coding - rubyconf edition
penelope_zone
0
260
Agile, etc.
penelope_zone
2
220
Extremely Defensive Coding
penelope_zone
0
96
Other Decks in Technology
See All in Technology
IPA&AWSダブル全冠が明かす、人生を変えた勉強法のすべて
iwamot
PRO
2
220
事例で学ぶ!B2B SaaSにおけるSREの実践例/SRE for B2B SaaS: A Real-World Case Study
bitkey
1
270
TableauLangchainとは何か?
cielo1985
1
140
CDK Vibe Coding Fes
tomoki10
1
450
20250708オープンエンドな探索と知識発見
sakana_ai
PRO
3
530
SREのためのeBPF活用ステップアップガイド
egmc
1
780
AWS CDK 入門ガイド これだけは知っておきたいヒント集
anank
4
490
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
7.8k
関数型プログラミングで 「脳がバグる」を乗り越える
manabeai
2
220
AWS CDK 開発を成功に導くトラブルシューティングガイド
wandora58
3
140
推し書籍📚 / Books and a QA Engineer
ak1210
0
120
CDKTFについてざっくり理解する!!~CloudFormationからCDKTFへ変換するツールも作ってみた~
masakiokuda
1
190
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Typedesign – Prime Four
hannesfritz
42
2.7k
A designer walks into a library…
pauljervisheath
207
24k
Into the Great Unknown - MozCon
thekraken
40
1.9k
KATA
mclloyd
30
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Practical Orchestrator
shlominoach
189
11k
Making Projects Easy
brettharned
116
6.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]