lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2013/9/24 Jayanth Acharya <jayachar88@gmail.com>:

>> Use `require("lpeg")` if you want to manually create all the patterns
>> or `require("re")` if you want to use a regular expression syntax
>> instead.
>
> If someone can share 2 small illustrative examples of when to use
> which one, or why -- it'd be excellent.

IMHO the "re" module is mainly useful as a demo of just how
powerful LPEG is. It will only save you time if you are already
a fair virtuoso with regular expressions. Otherwise, LPEG
directly just gives so much more lfexibility.