6

Formally, regular expressions only contain the union, concatenation, and star operations. However, regular languages are also closed under intersection and complementation. This means that a generalized regular expression, which allows the intersection and complementation operators, is equivalent to some standard regular expression without these explicit operations. How could I obtain such a regular expression from a generalized one? I would prefer a way that converts to it directly, instead of converting it to an NFA and then a standard regular expression.

Choosechee
  • 61
  • 1

1 Answers1

7

I'm not aware of any simple algorithm. I think the smallest regular expression might be exponentially larger than the corresponding generalized regular expression. Some references to investigate further:

D.W.
  • 167,959
  • 22
  • 232
  • 500