I'm using Lua string.match
to extract some values of a HTML but I'm having some problems with some attributes.
To extract a phone number like this: 0000-0000, I'm using the mask:
local value = string.match(STRING, "%d%d%d%d-%d%d%d%d")
But Lua is returning something like this: "0000000"
Where is the "-"
in the middle of the mask string?
And is there any way to do something like this:
"%d[4]-%d[4]"
(specifying how many chars will appear in string)
STRING
contains whenstring.match
is called? – Corregidor