I’m just starting on Lua Patterns.
I have a string
|2|34|56|1
How do I extract the numbers from the string?
I can parse the string manually and exclude all the ‘|’ characters. But I’m sure using Lua patterns will be much simpler.
How do patterns help in this case?
If you only want to print those numbers, the best method is:
Else, if you want the numbers to be stored in a table, a longer approach is required: