Mobile Number validation criteria:
- The first digit should contain number between 7 to 9.
- The rest 9 digit can contain any number between 0 to 9.
- The mobile number can have 11 digits also by including 0 at the starting.
- The mobile number can be of 12 digits also by including 91 at the starting
The number which satisfies the above criteria, is a valid mobile Number.
Input : Enter Mobile Number: 7873923408 Output :Valid Mobile Number Input : Enter Mobile Number: 5678729234 Output :Invalid Mobile Number
Prerequisites : Java Regular Expressions
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- How to check Aadhar number is valid or not using Regular Expression
- Check if a given string is a valid number (Integer or Floating Point) in Java
- Check if a given string is a valid number (Integer or Floating Point) in Java | SET 2 (Regular Expression approach)
- Java program to read all mobile numbers present in given file
- Check if URL is valid or not in Java
- Check if email address valid or not in Java
- Java program to check whether a string is a Palindrome
- Program to check if the String is Empty in Java
- Program to check if the String is Null in Java
- Program to check if a String in Java contains only whitespaces
- Java program to check palindrome (using library methods)
- Valid variants of main() in Java
- Java Program to Calculate Power of a Number
- Hello World Program : First program while learning Programming
- Check if two arrays are permutations of each other
- Check for string rotation in Java
- How to check if a key exists in a HashMap in Java
- Check if two strings are same ignoring their cases
- Check if a value is present in an Array in Java
- Check if a File is hidden in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.