REGEX → ε-NFA → NFA → DFA → MIN. DFA
ENTER REGULAR EXPRESSION
PRESS FOR PATTERNS
NO AUTOMATON DATA
NO STATE DATA
NO CONVERSION DATA
| OPERATOR | DESCRIPTION | EXAMPLE |
|---|---|---|
a |
Literal character | a matches "a" |
| |
Alternation (OR) | a|b matches "a" or "b" |
* |
Kleene star (0 or more) | a* matches "", "a", "aa", ... |
+ |
Plus (1 or more) | a+ matches "a", "aa", ... |
? |
Optional (0 or 1) | a? matches "" or "a" |
() |
Grouping | (ab)* matches "", "ab", "abab", ... |
ε |
Epsilon (empty string) | ε matches empty string |
AaBb
Matches exactly "AaBb" — uppercase and lowercase are distinct
(a|b)abb
Matches strings with one a or b followed by "abb"
ab|ba
Matches exactly "ab" or "ba"
a(a|b)b
Matches "aab" or "abb"
(aa|bb)
Matches "aa" or "bb"
a+b+
One or more a's followed by one or more b's
(ab|ba)*
Matches any sequence of "ab" or "ba"
(a|b)*abb(a|b)*
Contains the sequence "abb" anywhere
(a|b)(a|b)(a|b)
Matches any string of exactly length 3
a*b*c*
Any a's, then any b's, then any c's
(a|b)*aa(a|b)*
Matches infinite strings containing "aa"
(a|b)*a(a|b)(a|b)
Classic complex NFA to DFA example
This application converts your regular expression into a Deterministic Finite Automaton (DFA) through a multi-stage process. Here's how it works behind the scenes:
| (union), * (Kleene
star),
+ (one or more), ? (optional), and () (grouping).
When you test a string against the DFA:
| COMPONENT | TECHNOLOGY | PURPOSE |
|---|---|---|
| Parser | Recursive Descent | Converts regex string to AST |
| ε-NFA Builder | Thompson's Algorithm | AST to epsilon-NFA conversion |
| NFA Converter | Epsilon Closure | Removes epsilon transitions |
| DFA Builder | Subset Construction | NFA to DFA determinization |
| Visualization | D3.js Force Graph | Interactive automaton rendering |
| Simulator | State Machine | String acceptance testing |