Validate Mobile number using regular expression
Should be pretty simple:
^(?:\+?88)?01[15-9]\d{8}$
^
- From start of the string(?:\+?88)?
- optional88
, which may begin in+
01
- mandatory01
[15-9]
- "1 or 5 or 6 or 7 or 8 or 9"\d{8}
- 8 digits$
- end of the string
Working example: http://rubular.com/r/BvnSXDOYF8
Update 2020
As BTRC approved 2 new prefixes, 013 for Grameenphone and 014 for Banglalink, updated expression for now:
^(?:\+?88)?01[13-9]\d{8}$
You may use either one of given regular expression to validate Bangladeshi mobile number.
Solution 1:
/(^(\+88|0088)?(01){1}[56789]{1}(\d){8})$/
Robi, Grameen Phone, Banglalink, Airtel and Teletalk operator mobile no are allowed.
Solution 2:
/(^(\+8801|8801|01|008801))[1|5-9]{1}(\d){8}$/
Citycell, Robi, Grameen Phone, Banglalink, Airtel and Teletalk operator mobile no are allowed.
Allowed mobile number pattern
+8801812598624
008801812598624
01812598624
01712598624
01919598624
01672598624
01512598624
................
.................