Validate Mobile number using regular expression

后端 未结 7 1433
故里飘歌
故里飘歌 2020-12-30 12:37

I need to validate mobile number. My need:

  1. The number may start with +8801 or 8801 or 01
  2. The next number can be 1 or 5 or 6 or 7 or
7条回答
  •  借酒劲吻你
    2020-12-30 13:00

    **Laravel Bangladeshi Phone No validation for (Citycell, Robi, Grameen Phone, Banglalink, Airtel and Teletalk) and start with +88/88 then 01 then 356789 then 8 digit**  
    
    
    
    public function rules()
            {
                return [
    
                    'mobile' => 'sometimes|regex:/^(?:\+?88)?01[35-9]\d{8}$/',
    
                ];
            }
    
            public function messages()
            {
    
                    'mobile.regex' => 'Mobile no should be bd standard',
                ];
            }
    

提交回复
热议问题