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
100
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
570
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
360
extremely defensive coding - rubyconf edition
penelope_zone
0
270
Agile, etc.
penelope_zone
2
230
Extremely Defensive Coding
penelope_zone
0
98
Other Decks in Technology
See All in Technology
MagicPod導入から半年、オープンロジQAチームで実際にやったこと
tjoko
0
110
株式会社ログラス - 会社説明資料【エンジニア】/ Loglass Engineer
loglass2019
4
65k
5年目から始める Vue3 サイト改善 #frontendo
tacck
PRO
3
230
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
2
190
20250913_JAWS_sysad_kobe
takuyay0ne
2
250
今日から始めるAWSセキュリティ対策 3ステップでわかる実践ガイド
yoshidatakeshi1994
0
110
いま注目のAIエージェントを作ってみよう
supermarimobros
0
350
RSCの時代にReactとフレームワークの境界を探る
uhyo
10
3.5k
普通のチームがスクラムを会得するたった一つの冴えたやり方 / the best way to scrum
okamototakuyasr2
0
110
未経験者・初心者に贈る!40分でわかるAndroidアプリ開発の今と大事なポイント
operando
5
750
現場で効くClaude Code ─ 最新動向と企業導入
takaakikakei
1
260
Aurora DSQLはサーバーレスアーキテクチャの常識を変えるのか
iwatatomoya
1
1.2k
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Scaling GitHub
holman
463
140k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
The Language of Interfaces
destraynor
161
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
The Invisible Side of Design
smashingmag
301
51k
The Pragmatic Product Professional
lauravandoore
36
6.9k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Git: the NoSQL Database
bkeepers
PRO
431
66k
GraphQLの誤解/rethinking-graphql
sonatard
72
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
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]