-
Regular Expression
Are not my strength ;) beyond the simple ones I use regularly in grep and vi.
Which "flavor" of expressions are used in Lua/FG?
I used to plug in really complex expressions into various online "decomposers" like regexpr.com (forgot exact name) to show graphically what it is doing.
I suspect, glancing at https://riptutorial.com/lua/example/...ttern-matching after a search that Lua is not using a "standard" syntax of RE like pcre or grep(not sure which that is) or any of the others.
Figure if it has a name I could search for a translator to save my looking at them char at a time... cos yes, I like to avoid the effort :(
-
1 Attachment(s)
I mean for example if I tried to input
^align%s*%(([^)]+)%)$
on
https://regexper.com/#%5Ealign%25s*%...2B%29%25%29%24
it would translate it wrong:
Attachment 31598
Instead of:
<starts with>align<followed by 0..n spaces then>(<then it saves in a "group" 1..n characters until it sees the first>)<which should be the end of the line>
(unsure if that means it would not stop at first ")" if later there was a ")" at end of line..., e.g. align (1)111) -> would that NOT match or match the group as "1)111"? )
-
Lua doesn't use regex, it uses it's own "pattern matching" which is nowhere near as comprehensive as regex.
Start here to read up on it and here for pattern matching functions.
-
Lua uses its own pattern matching engine.
https://www.lua.org/pil/20.2.html
Here’s why:
https://stackoverflow.com/questions/...192354#6192354
I occasionally look for a pattern tester online; but haven’t found one that I have kept.
Regards,
JPG
-
Thanks, yeah, I just started looking at the patterns and realized what I thought they said was wrong (used to other regex) so then found some Lua reg expression info and was "oooo, I see..." and hoped there was a good scanner for it to avoid noob mistakes in my interpretations in case I used one of them as basis for new match string later.
I'll just have to be careful then :)