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
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
100
Teaching RSpec to play nice with Rails
penelope_zone
2
170
What is processor (brighton ruby edition)
penelope_zone
0
140
What is processor?
penelope_zone
1
380
extremely defensive coding - rubyconf edition
penelope_zone
0
290
Agile, etc.
penelope_zone
2
250
Extremely Defensive Coding
penelope_zone
0
130
Other Decks in Technology
See All in Technology
「AIに部下10人」を3ヶ月運用してわかった、生成AI駆動開発のリアル
yoheinabe777
0
110
ハーネスエンジニアリングの概要と設計思想
sergicalsix
9
5.5k
AIが自律的に働く時代へ Amazon Quick で実現するAIエージェント紹介
koheiyoshikawa
0
140
AWS Transform CustomでIaCコードを自由自在に変換しよう
duelist2020jp
0
190
20260428_Product Management Summit_Loglass_JoeHirose
loglassjoe
3
4.1k
Rapid Start: Faster Internet Connections, with Ruby's Help
kazuho
2
840
[OpsJAWS 40]リリースしたら終わり、じゃなかった。セキュリティ空白期間をAWS Security Agentで埋める
sh_fk2
3
270
Keeping Ruby Running on Cygwin
fd0
0
180
PicoRuby as a Multi-VM Operating System
kishima
1
220
AgentCore Managed Harness を使ってみよう
yakumo
2
250
AI時代のガードレールとしてのAPIガバナンス
nagix
0
310
Expiration of Secure Boot Certificates for vSphere Virtual Machines
mirie_sd
0
120
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
220
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
110
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
280
Paper Plane
katiecoart
PRO
1
49k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
270
How GitHub (no longer) Works
holman
316
150k
Mind Mapping
helmedeiros
PRO
1
170
The World Runs on Bad Software
bkeepers
PRO
72
12k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
200
How to Talk to Developers About Accessibility
jct
2
180
WCS-LA-2024
lcolladotor
0
550
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]