© Zsolt Nagy 2018
Zsolt NagyRegex Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-3876-9_4

4. Visualizing Regex Execution Using Finite State Machines

Zsolt Nagy1 
(1)
Berlin, Germany
 

A regular expression is converted into code executed in a virtual machine. This virtual machine runs on the virtual machine of the host language or editor.

Abstract models are helpful for understanding how regular expressions are executed. Although these models often neglect optimization techniques implemented by regex engines, they still give you valuable information on how regexes work.

Regular Expressions Are Finite State Machines

The easiest way to visualize a regular expression is with a finite state machine.1 A finite state machine (FSM) is a directed acyclic ...

Get Regex Quick Syntax Reference: Understanding and Using Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.