I'm trying to match a string against a pattern, but there's one thing I haven't managed to figure out. In a regex I'd do this:
Strings:
en
eng
engl
engli
englis
english
Pattern:
^en(g(l(i(s(h?)?)?)?)?)?$
I want all strings to be a match. In Lua pattern matching I can't get this to work.
Even a simpler example like this won't work:
Strings:
fly
flying
Pattern:
^fly(ing)?$
Does anybody know how to do this?
enlh
doesn't really suit. I'm going to have to workaround this by capturing the rest of the word(%a*)
and then checking if it's an allowable 'suffix'. Thanks anyways :) and I already expected this, but thanks for confirming and saying that it matches the literal?
– Kyrstin