Regular Expressions

When a User enters some information in a form provided on the website for Signup/Registration , we always have to validate, whether the information provided e.g username, password, email or contact number, are in the correct valid format or not. After this validation only, the data entered in the form is stored in the database. 

This is where Regular expressions provide a significant role. PHP also provides functions to compare the input data with these regular expression and check whether they are in valid format or not.

Below we will describe regular expressions of various fields of a Signup/Registration Form and then compare them with built in PHP functions to validate the User data. 

Get hands-on with 1200+ tech skills courses.