Regex Intersection Checker

Find the smallest word that matches two regular expressions using NFAs

Back to Home

Input

Supported Syntax
  • Literals: a, b, 0, etc.
  • Concatenation: ab (a followed by b)
  • Alternation: a|b (a or b)
  • Kleene star: a* (zero or more a's)
  • Plus: a+ (one or more a's)
  • Optional: a? (zero or one a)
  • Grouping: (ab)*

Example Pairs

  • a*b and ab*ab
  • (ab)* and (ba)*ε (empty string)
  • a+ and a*bab
  • (0|1)*0 and 0(0|1)*0