The built-in lua string library uses its own proprietary pattern matching code, for which I can't seem to find an OR (aka "|") regex equivalent.
I would like a more elegant solution, such as regex support in scripts themselves, or a way to have an OR operator for string matches. Any suggestions?
EDIT: By regex I mean PCRE or POSIX regular expressions. It seems the Programming in Lua book refers to the pattern matching of the string standard library as regular expressions, but it's quite limited (by design for speediness).
regex in string matching scripts
regex in string matching scripts
Last edited by Lucky24 on Tue Mar 29, 2011 4:52 am, edited 1 time in total.
Re: regex in string matching scripts
Um, no, it doesn't use proprietary matching code.
Regex support in scripts themselves is already included: http://rrthomas.github.com/lrexlib/manual.html#match
Regex support in scripts themselves is already included: http://rrthomas.github.com/lrexlib/manual.html#match
Re: regex in string matching scripts
Thanks! The programming in Lua book doesn't have any reference to this library, and a google search doesn't bring it up. Thanks.
And I should have quantified regular expressions as PCRE or POSIX.
And I should have quantified regular expressions as PCRE or POSIX.