Why is recursive regex not regex?

后端 未结 4 1765
一生所求
一生所求 2020-12-11 16:32

I was reading through some of the responses in this question and saw that a few people said that recursive regular expressions were not strictly speaking regular expressions

4条回答
  •  一个人的身影
    2020-12-11 17:15

    All regular languages can be recognized by a finite automaton. A finite automaton has a finite number of states, and consequently, finite memory (hence the name). A recursive "regular" expression requires a potentially infinite stack space to do the recursion, thus it is not possible to recognize it with a finite automaton, therefore it is not regular.

提交回复
热议问题