Andrii Raikov
How Regex Works: The Secret Sauce Behind Pattern Matching
#1about 4 minutes
Solving a LeetCode regex matching challenge
A LeetCode problem requiring a custom regex matcher for the dot and asterisk characters serves as the motivation for exploring how regex engines work.
#2about 2 minutes
Understanding the scalability limits of a naive approach
The initial linked-list implementation is not extensible enough to handle complex patterns like a real-world email validation regex.
#3about 3 minutes
How regex works using finite automata
Regular expressions can be modeled as finite automata, or state machines, which describe a set of character strings through states and transitions.
#4about 2 minutes
Comparing deterministic and non-deterministic finite automata
Non-deterministic Finite Automata (NFA) are more flexible for representing regex because a single input can lead to multiple possible next states.
#5about 5 minutes
Building an NFA from regular expression components
A complex regular expression is converted into an NFA by combining smaller NFA components for concatenation, alternation, and repetition operators.
#6about 2 minutes
The performance pitfalls of the backtracking algorithm
The backtracking approach, where the engine guesses a path and reverts on failure, can lead to exponential time complexity for complex patterns.
#7about 1 minute
Simulating an NFA by tracking all possible states
A more efficient simulation method avoids backtracking by simultaneously tracking the entire set of possible states the machine could be in at any point.
#8about 5 minutes
Implementing a simple NFA regex matcher in Go
A practical implementation involves compiling the regex pattern into an NFA data structure and then iterating through the input string while tracking the current set of active states.
#9about 2 minutes
Beyond one algorithm for real-world regex engines
Production-grade regex engines often use a hybrid approach, selecting from different algorithms like NFA simulation or backtracking based on the specific pattern.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
35:49 MIN
Using AI-powered tools to generate regular expressions
New Browser APIs, End of React Create App, Smuggling Data in Emoji and more with Rowdy Rabouw
09:22 MIN
Explaining and generating complex regular expressions
ChatGPT: Create a Presentation!
37:20 MIN
Why graphs can seem intimidating to developers
Graphs and RAGs Everywhere... But What Are They? - Andreas Kollegger - Neo4j
17:41 MIN
Presenting live web scraping demos at a developer conference
Tech with Tim at WeAreDevelopers World Congress 2024
25:14 MIN
Audience Q&A on patterns, typescript, and frameworks
10 must-know design patterns for JS Devs
04:33 MIN
Understanding language grammars and structure
Making Sense of Programming Languages
20:54 MIN
Live code demo of various AI application patterns
Building AI Applications with LangChain and Node.js
21:06 MIN
Advanced patterns for building sophisticated AI applications
Java Meets AI: Empowering Spring Developers to Build Intelligent Apps
Featured Partners
Related Videos
WeAreDevelopers LIVE - Vector Similarity Search Patterns for Efficiency and more
Chris Heilmann, Daniel Cranney, Raphael De Lio & Developer Advocate at Redis
Tips, tricks and quirks in .NET
Paweł Łukaszuk
The Eventloop in JavaScript - How does it work?
Christian Woerz
From Syntax to Singularity: AI’s Impact on Developer Roles
Anna Fritsch-Weninger
10 must-know design patterns for JS Devs
Erick Wendel
Exploring the Latest Features of .NET and C# by Building a Game
Rainer Stropek
Algebraic Data Types + Pattern Matching = Elegant and readable Java code
Balkrishna Rawool
A beginner’s guide to modern natural language processing
Jodie Burchell
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.


Software Engineer
Understanding Recruitment
Charing Cross, United Kingdom
React
Python
Machine Learning
Google Cloud Platform
Amazon Web Services (AWS)





Application Software Engineer - JavaScript
RedTech Recruitment
Cambridge, United Kingdom
Remote
£70K
CSS
D3.js
Redis
+6

Founding Engineer - React Native, Typescript
MathGPT
Canton d'Eu, France
Remote
€100-150K
API
TypeScript
React Native
