Is “regex” in modern programming languages really “context sensitive grammar”?

前端 未结 3 1614
死守一世寂寞
死守一世寂寞 2020-12-16 19:39

Over the years, \"regex\" pattern matching has been getting more and more powerful to the point where I wonder: is it really just context-sensitive-grammar matching? Is it a

3条回答
  •  星月不相逢
    2020-12-16 20:18

    In particular backreferences to capturing parentheses make regular expressions more complex than regular, context-free, or context-sensitive grammars. The name is simply historically grown (as many words). See also this section in Wikipedia and this explanation with an example from Perl.

提交回复
热议问题