I am trying to match a string to a pattern, but there is one thing that I could not figure out. In regex, I would do this:
Strings:
en
eng
engl
engli
englis
english
Pattern:
^en(g(l(i(s(h?)?)?)?)?)?$
I want all the lines to match each other. Compared to the Lua sample, I cannot get this to work.
An even simpler example like this will not work:
Strings:
fly
flying
Pattern:
^fly(ing)?$
Does anyone know how to do this?
source
share