Why does VIM have its own regex syntax?

前端 未结 3 1977
梦毁少年i
梦毁少年i 2020-12-03 00:46

Why do you have to make your regex \"very magic\" so that you don\'t have to escape your capture quotes? And if you set your environment to very magic, you are non-standard

3条回答
  •  我在风中等你
    2020-12-03 01:07

    Most vi (and therefore vim) features were derived from ed. vi and ed both predate perl by at least a decade or two. A better question might be "why doesn't Perl use the same regex syntax as vi?".

    Of course, one could also argue that the kinds of regular expressions that one would wish to write inside a text editor to perform common tasks are probably rather different to those you might wish to write inside a programming language.

提交回复
热议问题