regex - Regular Expression for a infinite language -


i'm kind of confused regular expressions. can there regular expression recognizes infinite language or regular expressions recognize finite languages?

it possible build regular expressions recognize infinite languages. example, simple regular expression a* matches infinite language

{ ε, a, aa, aaa, aaaa, ... }

the star operator essential in regular expressions enable them recognize infinite sets of strings.

it true finite languages regular, not regular languages finite (as shown above). formal language theory tells there lot of languages infinite not regular (such {0n1n | n ≥ 0}), though, can't write regular expression arbitrary infinite langugage.

hope helps!


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -