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
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Little machines that eat strings
A talk about regular expressions and computer science presented at SF dot RB
Penelope Phippen
August 02, 2016
More Decks by Penelope Phippen
See All by Penelope Phippen
Introducing Rubyfmt
penelope_zone
0
610
How RSpec Works
penelope_zone
0
6.8k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
110
Teaching RSpec to play nice with Rails
penelope_zone
2
180
What is processor (brighton ruby edition)
penelope_zone
0
140
What is processor?
penelope_zone
1
390
extremely defensive coding - rubyconf edition
penelope_zone
0
290
Agile, etc.
penelope_zone
2
260
Extremely Defensive Coding
penelope_zone
0
130
Other Decks in Technology
See All in Technology
2026TECHFRESH畢業分享會 - Lightning Talk - 打造精準高效的 MCP 設計模式與測試實務
line_developers_tw
PRO
0
1.1k
連合学習と機密コンピューティング
lycorptech_jp
PRO
0
120
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
2
650
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
200
20260619 私の日常業務での生成 AI 活用
masaruogura
1
220
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
210
新しいVibe Codingと”自走”について
watany
6
330
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
370
アンオフィシャルな、オフィシャルからのお願い
wyamazak_devrel
0
120
Claude Codeとのおしゃべりでセマンティックモデルの定義からダッシュボード作成まで完成させる
nic_sugiyama
0
120
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
230
AIはどのように 組織のアジリティを変えるのか?
junki
4
950
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
620
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Making Projects Easy
brettharned
120
6.7k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Evolving SEO for Evolving Search Engines
ryanjones
0
220
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
Writing Fast Ruby
sferik
630
63k
How to Talk to Developers About Accessibility
jct
2
230
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
Odyssey Design
rkendrick25
PRO
2
700
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]