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
79
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
500
How RSpec Works
penelope_zone
0
6.3k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
75
Teaching RSpec to play nice with Rails
penelope_zone
2
120
What is processor (brighton ruby edition)
penelope_zone
0
92
What is processor?
penelope_zone
1
340
extremely defensive coding - rubyconf edition
penelope_zone
0
230
Agile, etc.
penelope_zone
2
200
Extremely Defensive Coding
penelope_zone
0
76
Other Decks in Technology
See All in Technology
How to Lead? Testimonial of a Lead Android Engineer
oleur
1
120
AWS学習者向けにAzureの解説スライドを作成した話
handy
3
220
Google Cloud Next '24 Recap(Cloud Run/k8s)
mokocm
0
380
LangSmith入門―トレース/評価/プロンプト管理などを担うLLMアプリ開発プラットフォーム
os1ma
5
790
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
35k
M5stackで使用できるpHセンサの開発
shinrinakamura
1
290
生成AIと産業向けソフトウェアの自動生成 〜 ハノーバーメッセ2024より〜
kioto
2
270
社内アプリで Cloudflare D1を プロダクト運用してみた体験談(Tokyo)
haochenx
0
130
CockroachDB はどのくらい「しぶとい」のか? / How tough is CockroachDB?
kota2and3kan
6
4k
R3のコードから見る実践LINQ実装最適化・コンカレントプログラミング実例
neuecc
3
3.6k
Gitlab本から学んだこと - そーだいなるプレイバック / gitlab-book
soudai
7
1.4k
競技としてのKaggle、役に立つKaggle
yu4u
7
2.5k
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Build your cross-platform service in a week with App Engine
jlugia
226
17k
4 Signs Your Business is Dying
shpigford
176
21k
Building Adaptive Systems
keathley
32
1.9k
A designer walks into a library…
pauljervisheath
201
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Unsuck your backbone
ammeep
664
57k
Designing Experiences People Love
moore
136
23k
The Invisible Customer
myddelton
114
12k
How to name files
jennybc
65
93k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
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]