Visualize the Thompson-McNaughton-Yamada construction NFA for a given regular expression. The subset construction algorithm is also applied to the resultant NFA, resulting in a language-equivalent deterministic finite-state automata (DFA).

Why Regular Expressions Matter

Regular expressions are useful for validating, filtering, and classifying input. Most languages have support for regular expressions, however those regular expressions are often slowed down by extensions like the need for backtracking.

The graph corresponding to a regular expression can be encoded as a table and drive classification tools. Notably, "modern" (c. 1975) tools like Lex or the Construction Compiler Toolkit Scanner Generator create classification tools called "scanners" based off of the data represented in such graphs. Scanners are critical for breaking up input into identifiable parts that parsers can work on, and are a critical component of the compilation process chain.

Why Visualize the NFA for Regular Expressions

Visualizing the scanner is easier than eyeballing a massive table or associative array. This can help a little with debugging, in case, for some odd reason, you don't like just reading the regular expression itself. It can help clarify what's going on underneath the hood of regular expression engines. It can be fun to see how large regex NFAs get when determinized. Automatic visualization makes compiler design/construction coursework much less tedious.

Underlying Theory