← Back to team overview

ubuntu-phone team mailing list archive

Re: Search in contacts

 

On Fri, Jun 19, 2015 at 2:06 AM, Roman Shchekin <mrqtros@xxxxxxxxx> wrote:
> It's quite easier to check if text contains only digits and (or) other
> symbols which are available in a phone number.
> But which symbols are available in phone number? +, whitespace, (, ), -, any
> suggestions?
>

Add '#', '*' to the list. It is used in several countries to enable
services like disabling the sending of caller-id
when making a call, on a call-by-call basis
(https://en.wikipedia.org/wiki/Caller_ID#Disabling).
For example, you would type *31# and then the rest of the telephone number.

Simos

> I want to write something like this:
>
> var containsNumber = /^[0-9\s\+\-\(\)]+$/
> var containsLetter = !containsNumber
>
> 2015-06-19 1:52 GMT+03:00 Roman Shchekin <mrqtros@xxxxxxxxx>:
>>
>> Who wrote this code?
>>     var containsLetter = /^[a-zA-Z]/.test(value)
>> Are you serious? English-only letter checking in OS with best
>> internationalization. Can I unsee this?
>>
>> I will propose fix now.
>>
>> 2015-06-12 17:38 GMT+03:00 Christian Dywan
>> <christian.dywan@xxxxxxxxxxxxx>:
>>>
>>> More specifically
>>>
>>>
>>> https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/address-book-app/wily/view/head:/src/imports/Ubuntu/Contacts/ContactListModel.qml
>>>
>>> The looks a bit suspicious:
>>>
>>>     var containsLetter = /^[a-zA-Z]/.test(value)
>>>
>>>
>>> Am Fr, 12. Jun, 2015 um 9:28 schrieb Sebastien Bacher
>>> <sebastien.bacher@xxxxxxxxxxxxx>:
>>>
>>> Le 12/06/2015 15:17, Simos Xenitellis a écrit :
>>>
>>>
>>> I did not find something relevant in the source regarding to searching or
>>> filtering,
>>>
>>> https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/address-book-app/wily/files/head:/src/app/
>>> Where does the search take place?
>>>
>>> Simos
>>>
>>>
>>> It seems to be in that source
>>>
>>> https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/address-book-app/wily/view/head:/src/imports/ContactList/ContactListPage.qml
>>>
>>> Cheers,
>>> Sebastien Bacher
>>>
>>>
>>> --
>>> Mailing list: https://launchpad.net/~ubuntu-phone
>>> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~ubuntu-phone
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to     : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help   : https://help.launchpad.net/ListHelp
>


Follow ups

References