May be useful to refresh yourself on terms in Intro to Formal Languages, such as the ‘Kleene Star’.

Regular Expression Rules

Regular Expressions have some fundamental rules; I’ll present the rules along with the effect it has on the language generated.

  • if
    • if
  • if
  • if
  • if
  • if
RegexMeaningRegular Expression
is optional i.e. 0 or 1 occurrences of

Converting NFAs into Regex

Note that since DFAs are essentially NFAs, you can use this same approach for DFAs.