Re: I think I found a bug in Lua string.patterns, can anyone help see if it's true ?
Domingo Alvarez Duarte <[email protected]> Tue, 12 May 2026 05:25:22 -0700 (PDT)
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
Yes I did tried that pattern and it produce the expected result, but I'm really interested in know why the original pattern is failing, because I'm using it in a multi thousand lines text and it does work fine in most of the cases but fail in some (like the one I put on the first message and the two I put on the gist https://gist.github.com/mingodad/4f54e0c26b66f72b21476cab6fa9fa47 where one succedd and the other fail). On Tuesday, May 12, 2026 at 2:21:24 PM UTC+2 Spar wrote: > Correction. It's not actually the \n. It's because you used `[[ ]]` string > literals which works as C++ raw literals. They don't accept escapes. > > So what actually happens can be described by my tool which doesn't accept > escapes too (i will fix it some day) :-) > > https://gitspartv.github.io/lua-patterns/?pattern=%5B%5E%5Cn%5D* > On May 12, 2026 at 15:20 +0300, Luiz Henrique de Figueiredo < > [email protected]>, wrote: > > Try this simple pattern > > local remove_re = "Cuentas Anuales.-CREDITO%s+" > > -- > You received this message because you are subscribed to the Google Groups > "lua-l" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To view this discussion visit > https://groups.google.com/d/msgid/lua-l/CABt16qnGEsb6UYWW66PHzj6gey5g9AqWUCHpB7_zYA8P6N8Zag%40mail.gmail.com > . > > -- You received this message because you are subscribed to the Google Groups "lua-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/lua-l/525cf354-0bc0-4c54-afde-71296471f2cbn%40googlegroups.com.