[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: breaking down stream
- From: Henryla <henryla@...>
- Date: Tue, 13 May 2008 20:55:56 +0800
I would use a table for breaking down the phone number
phoneTable = {
1 = "<regular _expression_ for country code 1>",
852 = "<regula _expression_ for country code 852>"
}
phoneNumber = "<phone number>"
for k,v in pairs(phoneTable) do
s,e = string.find(phoneNumber,"^" .. tostring(k))
if s then
s,e,phones = string.find(phoneNumber,v)
< do any process you want >
end
end