Search code examples
regexalgorithmdfa

Regular expressions Equivalence


Is there a way to find out if two arbitrary regular expressions are equivalent? Looks like complex problem to me, but there might be some DFA simplification mechanism or something?


Solution

  • To test equivalence you can compute the minimal DFAs for the expressions and compare them.