lua-users home
lua-l archive

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


> IMHO the reason why 're' exists is not as a more convenient
> alternative to raw LPeg (for me, it isn't), nor yet as a sop to those
> who come to Lua from other languages (when was that ever a
> consideration), but as a demonstration that regex is not more powerful
> than LPeg
> 
> -- Dirk Laurie

Sometimes 're' is more concise, and convenient.
For example, try to match double words with raw LPeg:

> =re.match("this-this", "{:word: %a+ :} %A+ { =word }")
this