SlideShare una empresa de Scribd logo
1 de 104
Descargar para leer sin conexión
www.staffannoteberg.com
Jamie Zawinski
DevOps Borat
Andy Hood
Donald Knuth
stackoverflow.com
XKCD
User Friendly
Automata
Abstract Machine
Directed Graph
Alphabet
Latch Alphabet
States
Latch States
Transition Table
Latch Trans-Tab
NFA
Greedy
NFA/DFA Graph
Backtracking
DFA
Pushdown Automata
Chomsky hierarchy
Three Operators
Glob
History
grep -E and egrep
Match One
#1: Concat
#2: Alternation
Leftmost
#3: Kleene Star
Precedence
Even
FA ↔ Regex ↔ Graph
Regex → Automaton
# Declarative # Domain Specific (DSL) # No whitespace or delimeters

 Regex Traits

              # Declarative

              # Domain Specific (DSL)

              # No whitespace or delimiters
Architecture
Functions
Func #1: Verify
Func #2: Find
Func #3: Replace
Func #4: Filter
Func #5: Parse
Quantifiers
Quant Algebra
Possessive Quant
Meta chars
Dot
Shrthnds
Unicode
Escape
Character Class
Char Class Escape
Canonical
Non-printable
Back Reference
Finite
Regular Regex
Capture & Back ref
Non-capturing
Named Captures
Atomic Group
Assertion
Anchors
Modes
Lookarounds
Capture Cond
Assert Cond
Prime numbers
Best Practices
IS0 8601 – Global Time
IS0 8601 – Global Time
Applications
Literal
Dialects
Dialects
Split
Split
Study example
Inside Out
Accept incorrect
Deny correct
Simple method
Web Test Bench
REPL Test Bench
Consider Modes
Documentation
Imperative & Regex
Regex Inject Attack
Group over Prec.
Use Lazy Quantifiers
Context Unaware
Fail Fast
Don't over-escape
Compile Once
Economical Dot
+ over *
Boundaries in Find
No Nested Quantifiers
Palindrome
TDD
www.staffannoteberg.com

Más contenido relacionado

Similar a 2011-09-19 Regex Day

NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandrarantav
 
Concurrency Constructs Overview
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overviewstasimus
 
The design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBThe design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBTerry Jones
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrencyAlex Navis
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsLourens Naudé
 
Generics Past, Present and Future (Latest)
Generics Past, Present and Future (Latest)Generics Past, Present and Future (Latest)
Generics Past, Present and Future (Latest)RichardWarburton
 
Cassandra Explained
Cassandra ExplainedCassandra Explained
Cassandra ExplainedEric Evans
 
CNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugsCNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugsSam Bowne
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmerselliando dias
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfakAsfak Mahamud
 
Ch 2.pptx
Ch 2.pptxCh 2.pptx
Ch 2.pptxwoldu2
 
Stop overusing regular expressions!
Stop overusing regular expressions!Stop overusing regular expressions!
Stop overusing regular expressions!Franklin Chen
 
Saumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona TucsonSaumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona Tucsonjeronimored
 
Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...Alexey Diyan
 
Reverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on LinuxReverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on LinuxRick Harris
 
Text tagging with finite state transducers
Text tagging with finite state transducersText tagging with finite state transducers
Text tagging with finite state transducerslucenerevolution
 

Similar a 2011-09-19 Regex Day (20)

NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
Concurrency Constructs Overview
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overview
 
The design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBThe design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDB
 
Clojure concurrency
Clojure concurrencyClojure concurrency
Clojure concurrency
 
RailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMsRailswayCon 2010 - Dynamic Language VMs
RailswayCon 2010 - Dynamic Language VMs
 
Generics Past, Present and Future (Latest)
Generics Past, Present and Future (Latest)Generics Past, Present and Future (Latest)
Generics Past, Present and Future (Latest)
 
Cassandra Explained
Cassandra ExplainedCassandra Explained
Cassandra Explained
 
CNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugsCNIT 127 Ch 4: Introduction to format string bugs
CNIT 127 Ch 4: Introduction to format string bugs
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfak
 
Ch 2.pptx
Ch 2.pptxCh 2.pptx
Ch 2.pptx
 
Stop overusing regular expressions!
Stop overusing regular expressions!Stop overusing regular expressions!
Stop overusing regular expressions!
 
Rust presentation convergeconf
Rust presentation convergeconfRust presentation convergeconf
Rust presentation convergeconf
 
Pcd question bank
Pcd question bank Pcd question bank
Pcd question bank
 
Saumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona TucsonSaumya Debray The University of Arizona Tucson
Saumya Debray The University of Arizona Tucson
 
Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...
 
Reverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on LinuxReverse-engineering: Using GDB on Linux
Reverse-engineering: Using GDB on Linux
 
Text tagging with finite state transducers
Text tagging with finite state transducersText tagging with finite state transducers
Text tagging with finite state transducers
 
Meta Object Protocols
Meta Object ProtocolsMeta Object Protocols
Meta Object Protocols
 

Más de Staffan Nöteberg

2013-11-27 JDays - Spider and Ants
2013-11-27 JDays - Spider and Ants2013-11-27 JDays - Spider and Ants
2013-11-27 JDays - Spider and AntsStaffan Nöteberg
 
2013 03-12 Change – How long does it take?
2013 03-12 Change – How long does it take?2013 03-12 Change – How long does it take?
2013 03-12 Change – How long does it take?Staffan Nöteberg
 
2012-02-15 jfokus2012 - regex applied
2012-02-15 jfokus2012 - regex applied2012-02-15 jfokus2012 - regex applied
2012-02-15 jfokus2012 - regex appliedStaffan Nöteberg
 
Regex -- Turku Agile Day 011
Regex -- Turku Agile Day 011Regex -- Turku Agile Day 011
Regex -- Turku Agile Day 011Staffan Nöteberg
 
2011 01-21 Timeboxed Thinking
2011 01-21 Timeboxed Thinking2011 01-21 Timeboxed Thinking
2011 01-21 Timeboxed ThinkingStaffan Nöteberg
 
Agila Sverige 2010 - Timeboxed Thinking
Agila Sverige 2010 - Timeboxed ThinkingAgila Sverige 2010 - Timeboxed Thinking
Agila Sverige 2010 - Timeboxed ThinkingStaffan Nöteberg
 
La Tomatina - 27th August 2008 in Bunõl
La Tomatina - 27th August 2008 in BunõlLa Tomatina - 27th August 2008 in Bunõl
La Tomatina - 27th August 2008 in BunõlStaffan Nöteberg
 

Más de Staffan Nöteberg (11)

2013-11-27 JDays - Spider and Ants
2013-11-27 JDays - Spider and Ants2013-11-27 JDays - Spider and Ants
2013-11-27 JDays - Spider and Ants
 
2013 03-12 Change – How long does it take?
2013 03-12 Change – How long does it take?2013 03-12 Change – How long does it take?
2013 03-12 Change – How long does it take?
 
2012-02-15 jfokus2012 - regex applied
2012-02-15 jfokus2012 - regex applied2012-02-15 jfokus2012 - regex applied
2012-02-15 jfokus2012 - regex applied
 
SHRUGSE regex cheat sheet
SHRUGSE regex cheat sheetSHRUGSE regex cheat sheet
SHRUGSE regex cheat sheet
 
Regex -- Turku Agile Day 011
Regex -- Turku Agile Day 011Regex -- Turku Agile Day 011
Regex -- Turku Agile Day 011
 
2011 01-21 Timeboxed Thinking
2011 01-21 Timeboxed Thinking2011 01-21 Timeboxed Thinking
2011 01-21 Timeboxed Thinking
 
Agila Sverige 2010 - Timeboxed Thinking
Agila Sverige 2010 - Timeboxed ThinkingAgila Sverige 2010 - Timeboxed Thinking
Agila Sverige 2010 - Timeboxed Thinking
 
Daily Mind Map
Daily Mind MapDaily Mind Map
Daily Mind Map
 
Lean Dictionary
Lean DictionaryLean Dictionary
Lean Dictionary
 
La Tomatina - 27th August 2008 in Bunõl
La Tomatina - 27th August 2008 in BunõlLa Tomatina - 27th August 2008 in Bunõl
La Tomatina - 27th August 2008 in Bunõl
 
XP Bill of Rights
XP Bill of RightsXP Bill of Rights
XP Bill of Rights
 

Último

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 

Último (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 

2011-09-19 Regex Day