联系人号码显示匹配规则


保存记录方便后续工作中使用。


1、系统语言为英文状态下,新建一个联系人号码(如0504285105 或*121# 或+97155678161),保存;

2、切换系统语言为阿拉伯文,进入联系人界面查看号码显示

[实际结果]号码变为5105428050 , 121#*  ,816156755971+

[期望结果]号码应仍显示0504285105  , *121#  , +97155678161

  //,20161209,add ,optimize boot contacts speed ,200ms
    private static Pattern mPatternsPhone=null;
    //#ifdef LAVA_EIDT
    //20170110 add for bug 13294
    private static final String NUM_PATTERN = "[+]?[[0-9][*#pw,;][\\s*]]+[[0-9][*#pw,;][\\s*]]*";


    public static void initPatternsPhone() {
/*        mPatternsPhone = Pattern.compile(       // sdd = space, dot, or dash
                "(\\+[0-9]+[\\- \\.]*)?"        // +<digits><sdd>*
                + "(\\([0-9]+\\)[\\- \\.]*)?"   // (<digits>)<sdd>*
                + "([0-9][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>*/
        mPatternsPhone = Pattern.compile(NUM_PATTERN);
    }
    // #endif
    //#endif
    public static boolean isPossiblePhoneNumber(CharSequence text) {
      
        //,20161209,add ,optimize boot contacts speed ,200ms
        if(mPatternsPhone == null)
        {
            initPatternsPhone();
        }
        //#endif

        //20161209,modify ,optimize boot contacts speed ,200ms
        return text == null ? false : mPatternsPhone.matcher(text.toString()).matches();
  
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值