I guess LPeg is a Lua thing, hadn't heard of it before. The docs here look pretty gnarly, but might just be because I'm more familiar with regex syntax 😂
I like the idea of lpeg.P(string) being an exact string match though. Currently, interpolated strings are treated as regex fragments like what you'd pass to the native RegExp constructor, so regex`a${'.'}` compiles to /a./, rather than /a\./. I think I'll keep this behavior as it's more intuitive, but might be worth adding a helper function for creating exact string matches.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
*Laughs in LPeg*
I guess LPeg is a Lua thing, hadn't heard of it before. The docs here look pretty gnarly, but might just be because I'm more familiar with regex syntax 😂
I like the idea of
lpeg.P(string)
being an exact string match though. Currently, interpolated strings are treated as regex fragments like what you'd pass to the nativeRegExp
constructor, soregex`a${'.'}`
compiles to/a./
, rather than/a\./
. I think I'll keep this behavior as it's more intuitive, but might be worth adding a helper function for creating exact string matches.