lua-users home
lua-l archive

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


2017-02-24 10:14 GMT+02:00 steve donovan <steve.j.donovan@gmail.com>:
> On Fri, Feb 24, 2017 at 5:11 AM, Coda Highland <chighland@gmail.com> wrote:
>> Perl Compatible Regular Expressions. It's supported by Perl
>> (obviously), Python, PHP, Javascript, and thanks to libpcre pretty
>> much any language that can load C libraries.
>
> And it's larger than the whole of Lua ;)
>
> Very powerful, very prone to write-once-and-never-read.  I've felt
> that the lesser power of Lua string patterns is a blessing, not a
> curse. It forces people to use if statements ;)

Lua's string handling (like so much of Lua) is a perfect compromise between
power and simplicity. I miss it so much when forced to use some regexp
dialect instead, e.g. when trying to compose a search-and-replace in vim.
The mnemonic power of alpha-coded character classes with uppercase
meaning the complementary class! The "if in doubt, escape it anyway" rule
that saves you from looking up every time whether a special character is
magic!