I need to validate mobile number. My need:
- The number may start with +8801 or 8801 or 01
- The next number can be 1 or 5 or 6 or 7 or
Should be pretty simple:
^(?:\+?88)?01[15-9]\d{8}$
^ - From start of the string(?:\+?88)? - optional 88, which may begin in +01 - mandatory 01[15-9] - "1 or 5 or 6 or 7 or 8 or 9"\d{8} - 8 digits$ - end of the stringWorking 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}$