[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: breaking down stream
- From: "Jeff Pohlmeyer" <yetanothergeek@...>
- Date: Mon, 12 May 2008 21:33:29 -0500
KHMan wrote:
> Pete Kay wrote:
> > For instance, 16502839332 -> 1 650 2839332
> For a line like the above, you can use something like (untested):
> ... string.match(x, "^(%d+)%s+%->%s+(%d+)%s+(%d+)%s+(%d+)$")
I think he means, take the string "16502839332" and
split it into the fields "1" "650" "2839332"
Something like (also untested):
country,area,localnum=string.match(x, '(%d)(%d%d%d)(%d%d%d%d%d%d%d)')
- Jeff