Lua pattern matching vs. regular expressions

前端 未结 3 525
执念已碎
执念已碎 2020-12-04 12:44

I\'m currently learning lua. regarding pattern-matching in lua I found the following sentence in the lua documentation on lua.org:

Nevertheless, patte

3条回答
  •  一整个雨季
    2020-12-04 13:31

    http://lua-users.org/wiki/LibrariesAndBindings contains a listing of functionality including regex libraries if you wish to continue using them.

    To answer the question (and note that I'm by no means a Lua guru), the language has a strong tradition of being used in embedded applications, where a full regex engine would unduly increase the size of the code being used on the platform, sometimes much larger than just all of the Lua library itself.

    [Edit] I just found in the online version of Programming in Lua (an excellent resource for learning the language) where this is described by one of the principles of the language: see the comments below [/Edit]

    I find personally that the default pattern matching Lua provides satisfies most of my regex-y needs. Your mileage may vary.

提交回复
热议问题