One common use of regular expressions is for form validation. Using regular expressions, we can check to ensure that password use the correct characters, that email addresses contain domain information, and more. In this learning activity, we’ll create various regular expressions to validate a number of fields in a registration form, making sure our front-end users can create accounts.
Successfully complete this lab by achieving the following learning objectives:
- Set the regex expression for the name value.
Define a regular expression for the
- Set the regex expression for the email value.
- Set the regex expression for the username value
Define the regular expression for the
- Set the regex for the password value.
password_valto an appropriate regular expression.
- Set the regex for the credit card value.
credit_valto a regular expression to match a credit card.