Search code examples
regular-languagedfa

Is Regular language always infinite


I'm kind of confused by the concept of regular language. Since all regular language can be accepted by a dfa and dfa always has loops in it. So it seems like the dfa can accpet infinite number of strings. Does it mean all regular language is infinite? What about empty set. Is it a regular language?


Solution

  • The definition of regular language includes the empty set. It also includes the singleton language {a}, so no, not all regular languages are infinite.