How To Validate 10 Digit Mobile Number Using Regular Expression

In this artical we will see how to validate 10 digit mobile number using regular expression in php or laravel. here i will give you example of regex for 10 digit mobile number in jquery,

Regular Expression through user can enter numbers in different format as per their requirments. When we are working with form validation at that time you need to restrict user to enter invalid value and users allow only numeric value or valid number.  So let's see regular expression for 10 digit mobile number

Example : 

<html>
<head>
   <title>How To Validate 10 Digit Mobile Number Using Regular Expression - techsolutionstuff.com 
   </title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<form>
    <h1>How To Validate 10 Digit Mobile Number Using Regular Expression - techsolutionstuff.com</h1>
   <div class="col-md-6">
    <label>Mobile Number: </label>
    <input class="form-control" type="text" name="mo_no" placeholder="Mobile Number" minlength="10" maxlength="10" required>
    <br>
    <label>Mobile Number: </label>
  	<input type="text" class="form-control" name="mo_no" placeholder="Mobile Number" pattern="[1-9]{1}[0-9]{9}"  required ><br>
    <button type="submit" class="btn btn-success">Submit</button>
  </div>
</form>
</body>
</html>

 

regular_expression_for_10_digit_mobile_number


 

You May Also Like :

techsolutionstuff

Techsolutionstuff | The Complete Guide

I'm a software engineer and the founder of techsolutionstuff.com. Hailing from India, I craft articles, tutorials, tricks, and tips to aid developers. Explore Laravel, PHP, MySQL, jQuery, Bootstrap, Node.js, Vue.js, and AngularJS in our tech stack.

RECOMMENDED POSTS

FEATURE POSTS