Introduction

Convert simple regular expressions to minimum deterministic finite automaton. (Regex => NFA => DFA => Min-DFA)

Raw regex on top supports only the ranges a-z, A-Z, and 0-9. You can escape single characters like \+ or \@ will be interpreted to literally match the + and @ symbol respectively. Note that \@ is redundant and can be simply passed as @ as well. Escaped whitespace characters like \n, \t, \r etc are special cased to match the single character (i.e. like '\n') etc. We also support \w for a-zA-Z0-9_, \d for 0-9, and \s for whitespace characters (\t\r\n\v\f). If you want more functionality or better compatibility with existing regex patterns, we recommend using [the V2 CLI instead](https://github.com/zkemail/zk-regex). To understand what ZK Regex is and how it works, see our blog post.


Supported raw regex grammars

  • r = (s)
  • r = st
  • r = s|t
  • r = s*
  • r = s+
  • r = s?
  • r = [stu]
  • r = A-Z
  • r = a-z
  • r = 0-9
  • r = \_ (one char escapes only)
  • r = ϵ
    (Copy this character to input if needed)

Supported parsed regex grammars

  • r = (s)
  • r = st
  • r = s|t
  • r = s*
  • r = s+
  • r = s?
  • r = ϵ
    (Copy this character to input if needed)

Example raw regexes

  • (a|b)*
  • (a*|b*)*
  • ((ϵ|a)b*)*
  • (a|b)*abb(a|b)*
  • a([a-zA-Z0-9\+]+0b*)*

The raw regex field supports a small subset of regex syntax, see above. 'Submit' will automatically "parse" it into an expanded parsed form, then display the DFA.


Hovering on states will highlight nodes that correspond to states in the table.