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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Penelope Phippen
August 02, 2016
Technology
1
120
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
600
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
160
What is processor (brighton ruby edition)
penelope_zone
0
130
What is processor?
penelope_zone
1
380
extremely defensive coding - rubyconf edition
penelope_zone
0
290
Agile, etc.
penelope_zone
2
240
Extremely Defensive Coding
penelope_zone
0
120
Other Decks in Technology
See All in Technology
Open Table Formatにおけるストレージ抽象化の比較
lycorptech_jp
PRO
1
180
今、求められるデータエンジニア
waiwai2111
2
1.2k
Getting started with Google Antigravity
meteatamel
0
280
Agent Payments Protocolで実装するAIエージェント間取引
tokio007
0
120
AI駆動開発とRAGプロダクトへの挑戦の軌跡 - 弁護士ドットコムでの学びから -
bengo4com
2
500
Three-Legged OAuth in AgentCore Gateway
hironobuiga
2
120
Amazon Bedrock AgentCoreでブラウザ拡張型AI調査エージェントを開発した話 (シングルエージェント編)
nasuvitz
2
100
ローカルでLLMを使ってみよう
kosmosebi
0
130
技術選定 したい人 したくない人
shirayanagiryuji
0
220
生成AIで始める業務改革 - 製造業編 in 福島 -
daikikanemitsu
2
620
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
2
1.1k
LLMOpsのこれまでとこれからを学ぶ
nsakki55
2
640
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
0
2k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
79
Statistics for Hackers
jakevdp
799
230k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Why Our Code Smells
bkeepers
PRO
340
58k
A Soul's Torment
seathinner
5
2.3k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
61
Designing Powerful Visuals for Engaging Learning
tmiket
0
250
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Utilizing Notion as your number one productivity tool
mfonobong
3
230
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
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]