2011-09-19 Regex Day
-
Upload
staffan-noeteberg -
Category
Education
-
view
526 -
download
2
description
Transcript of 2011-09-19 Regex Day
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
Regex Traits # Declarative # Domain Specific (DSL) # No whitespace or delimeters
# 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