phone-number

How to remove non numeric characters from phone number in objective-c?

主宰稳场 提交于 2019-11-30 11:32:52
This is my first attempt to make an ios app. I'm using people picker to ask the user for a phone number, but when it retrieves with the code below, my NSString *phone apears like (0) 111192222-2222. I'm from Brazil and here the correct mask for mobile phone numbers is (01111) 92222-2222 (the 9 is optional, some numbers have others don't). How to fix this mask? Or remove it entirely? - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier

Retrieving a phone number with ContactsContract in Android - function doesn't work

无人久伴 提交于 2019-11-30 10:14:30
I wrote the following function in order to retrieve one single phone number that belongs to the contact with id "contactID". The function which is to retrieve the phone number: private String getContactPhone(String contactID) { Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; String[] projection = null; String where = ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = ?"; String[] selectionArgs = new String[] { contactID }; String sortOrder = null; Cursor result = managedQuery(uri, projection, where, selectionArgs, sortOrder); if (result.moveToFirst()) { String phone = result

Extracting phone numbers from a free form text in python by using regex

烂漫一生 提交于 2019-11-30 09:52:36
问题 I have to extract phone numbers from free form of texts. How can I manage it by using reg-ex in python? I have found for one in order to extract e-mail addresses. https://gist.github.com/dideler/5219706 I have implemented the same approach by using a phone number regex instead of e-mail address regex, but I couldn't get output. def get_phoneNumber(text): phone_number = "" regex = re.compile("((\(\d{3,4}\)|\d{3,4}-)\d{4,9}(-\d{1,5}|\d{0}))|(\d{4,12})") for phoneNumber in get_phoneNumbers(text,

RegEx: Uk Landlines, Mobile phone numbers

拟墨画扇 提交于 2019-11-30 07:39:43
问题 I've been struggling with finding a suitable solution :- I need an regex expression that will match all UK phone numbers and mobile phones. So far this one appears to cover most of the UK numbers: ^0\d{2,4}[ -]{1}[\d]{3}[\d -]{1}[\d -]{1}[\d]{1,4}$ However mobile numbers do not work with this regex expression or phone-numbers written in a single solid block such as 01234567890. Could anyone help me create the required regex expression? 回答1: Would this regex do? // using System.Text

Searching for phone numbers in mysql

断了今生、忘了曾经 提交于 2019-11-30 07:13:35
I have a table which is full of arbitrarily formatted phone numbers, like this 027 123 5644 021 393-5593 (07) 123 456 042123456 I need to search for a phone number in a similarly arbitrary format ( e.g. 07123456 should find the entry (07) 123 456 The way I'd do this in a normal programming language is to strip all the non-digit characters out of the 'needle', then go through each number in the haystack, strip all non-digit characters out of it, then compare against the needle, eg (in ruby) digits_only = lambda{ |n| n.gsub /[^\d]/, '' } needle = digits_only[input_phone_number] haystack.map(

Parse Phone Number into component parts

风格不统一 提交于 2019-11-30 06:55:47
I need a well tested Regular Expression (.net style preferred), or some other simple bit of code that will parse a USA/CA phone number into component parts, so: 3035551234122 1-303-555-1234x122 (303)555-1234-122 1 (303) 555 -1234-122 etc... all parse into: AreaCode: 303 Exchange: 555 Suffix: 1234 Extension: 122 mmoossen None of the answers given so far was robust enough for me, so I continued looking for something better, and I found it: Google's library for dealing with phone numbers I hope it is also useful for you. This is the one I use: ^(?:(?:[\+]?(?<CountryCode>[\d]{1,3}(?:[ ]+|[\-.])))?

return largest phone number in JS array

寵の児 提交于 2019-11-30 06:09:29
问题 I have to return the largest phone number,not index, from an array in Javascript. I am trying to remove the non digit characters then find largest number. I am new and not experienced with the syntax. Alot of examples show parts of my problem. I don't know how to connect them into one function and how to return the answer. Please help me out. Heres what I have: function myFunction(array) { var largest = array.replace(/\D/g, ''); for (var i = 0; i < array.length; i++) { if (largest < array[i])

how to get MSISDN number in WAP using PHP?

假装没事ソ 提交于 2019-11-30 05:27:49
I have developed a WAP application and I would like to get the MSISDN of the users that visit my site. My operator has white listed my WAP application. I am getting MSISDN successfully on couple of Samsung Mobiles, but not getting same result on Nokia, BlackBerry & iPhone deviceas. Please suggest me best way to get MSISDN number for all devices. The ability to get the MSISDN of the user visiting the WAP site depends on a number of things. Firstly, the user has to be on Mobile Data. If the user is on WiFi then you will not receive this information. Secondly, the users mobile network has to

phone number should be a string or some numeric type that have capacity to save phone number?

て烟熏妆下的殇ゞ 提交于 2019-11-30 02:37:56
问题 We want to store 10 digit mobile number i.e.9999999999. Should it be numeric or string datatype? We don't want to do any calculative or manipulation operation on this Which is better memory and performance wise? 回答1: ITU-T recommendation E.164 says you need 3 digits for the country code and up to 15 digits for the directory number within the country dialing plan. And, many people add some punctuation. For example: +1.212.555.1212 is a North American number. It could also be rendered (212) 555

Get country name from Country code in python?

时光毁灭记忆、已成空白 提交于 2019-11-30 02:00:54
问题 I have worked with 2 python libraries: phonenumbers, pycountry. I actually could not find a way to give just country code and get its corresponding country name. In phonenumbers you need to provide full numbers to parse . In pycountry it just get country ISO. Is there a solution or a method in any way to give the library country code and get country name? 回答1: The phonenumbers library is rather under-documented; instead they advice you to look at the original Google project for unittests to