I need a regular expression to validate the mobile number up to 9 digits, if the telephone number starts with 8 otherwise 10 digits needs to be entered. The numbers must sta开发者_开发问答rt either with 9 or 8 with above criteria.
^(8\d{8}|[1-79]\d{9})$
Not sure about the answer, but you should check out this very useful website for reg expressions incase you are interested:
http://www.regexlib.com
http://www.regexlib.com/CheatSheet.aspx
Use the following regular expression to match the phone numbers starting with 8 or 9.
^8|9(8\d{8}|[1-79]\d{9})$
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论