There is an Apache-licensed project that deals with i18n phone-number validation:
http://code.google.com/p/libphonenumber/ Perhaps it could be ported as an Apache Flex Phone Number Validator? On Tue, Feb 14, 2012 at 2:48 PM, Glenn Williams <i...@tinylion.co.uk> wrote: > Hi David. > > Just to make matters worse. Here's the formatting > rules for UK phone numbers needed to make any > formatting complete. Ive actually just finished > this last week in an app for a client here in the > UK. > > Sorry if you already know this, I just thought I'd > add it to point out the whole problem > > Cheers > > Glenn > Tinylion uk > > UK Telephone pattern match: > > (02x) xxxx xxxx > (01x1) xxx xxxx > (011x) xxx xxxx > (01xxx) xxxxxx > (01xxx) xxxxx > (01xxxx) xxxxx > (016977) xxxx > (01###) #####[#] > (011#) ### #### > (01#1) ### #### > (013873) ##### > (015242) ##### > (015394) ##### > (015395) ##### > (015396) ##### > (016973) ##### > (016974) ##### > (016977) ####[#] > (017683) ##### > (017684) ##### > (017687) ##### > (019467) ##### > (02#) #### #### > > 03## ### #### > 05### ###### > 0500 ###### > 07### ###### > 08## ### ###[#] > 09## ### #### > > > > -----Original Message----- > From: David Arno [mailto:da...@davidarno.org] > Sent: 14 February 2012 16:48 > To: flex-dev@incubator.apache.org > Subject: RE: Other locales for Flex SDK > > > From: Justin Mclean > [mailto:jus...@classsoftware.com] > > Sent: 14 February 2012 13:25 > > > > With minimal changes (phone format and currency > symbol would be all I > > think) it could be converted to an en_GB locale. > I have started working my way through Justin's > patch to convert it to an en_GB version, but I'm > stuck on phone numbers. The rules for phone number > formats are complex in the UK and I don't know the > best way of expressing the formatter. > > For example, these are all valid, properly > formatted, UK numbers: > > +44 20 xxxx xxxx > (020) xxxx xxxx > (016977) xxxx > 0800 xxxxxx > 0800 xxx xxxx > 01332 050xxx > 074xx xxxxxx > > When the number starts with the international > dialling code details - +44, - then the 0 at the > beginning of the number is dropped, the area code > (if the number has one) is mandatory and is shown > separated by spaces. Finally, the rest of the > number is shown, formatted depending on length. > > If the number has an optional area code (which > varies in length from 3 to 6 digits), then that > area code is shown inside () brackets. If the > 0xx... part is mandatory (such as with 07... > mobile numbers) then no ()'s are used. > > Can anyone give me a clue how to tackle this? > > David. > >