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
84
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
540
How RSpec Works
penelope_zone
0
6.5k
Quick and easy browser testing using RSpec and Rails 5.1
penelope_zone
1
77
Teaching RSpec to play nice with Rails
penelope_zone
2
120
What is processor (brighton ruby edition)
penelope_zone
0
95
What is processor?
penelope_zone
1
340
extremely defensive coding - rubyconf edition
penelope_zone
0
250
Agile, etc.
penelope_zone
2
210
Extremely Defensive Coding
penelope_zone
0
90
Other Decks in Technology
See All in Technology
手を動かしてレベルアップしよう!
maruto
0
250
リクルートのエンジニア組織を下支えする 新卒の育成の仕組み
recruitengineers
PRO
2
180
OCI Success Journey OCIの何が評価されてる?疑問に答える事例セミナー(2025年2月実施)
oracle4engineer
PRO
2
220
Snowflake ML モデルを dbt データパイプラインに組み込む
estie
0
120
AIエージェント開発のノウハウと課題
pharma_x_tech
9
4.9k
Platform Engineeringで クラウドの「楽しくない」を解消しよう
jacopen
4
210
Ruby on Railsで持続可能な開発を行うために取り組んでいること
am1157154
3
170
LINEギフトにおけるバックエンド開発
lycorptech_jp
PRO
0
440
Amazon Athenaから利用時のGlueのIcebergテーブルのメンテナンスについて
nayuts
0
120
Apache Iceberg Case Study in LY Corporation
lycorptech_jp
PRO
0
380
株式会社Awarefy(アウェアファイ)会社説明資料 / Awarefy-Company-Deck
awarefy
3
12k
RayでPHPのデバッグをちょっと快適にする
muno92
PRO
0
200
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
We Have a Design System, Now What?
morganepeng
51
7.4k
Gamification - CAS2011
davidbonilla
80
5.2k
The Invisible Side of Design
smashingmag
299
50k
Docker and Python
trallard
44
3.3k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Automating Front-end Workflow
addyosmani
1369
200k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
115
51k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
52k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.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 sphippen@do.co