Learn HTML Forms by Building a Registration Form - Step 22

It keeps giving me this error message. You should give the pattern attribute a value of [a-z0-5]{8,} .

This is what it is asking me to do: Add a pattern attribute to the password input element to require the input match: [a-z0-5]{8,}

The above is a regular expression which matches eight or more lowercase letters or the digits 0 to 5. Then, remove the minlength attribute, and try it out.

Where do I place the pattern attribute?

  **Your code so far**
/* file: index.html */
<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <title>Registration Form</title>
  <link rel="stylesheet" href="styles.css" />
  <h1>Registration Form</h1>
  <p>Please fill out this form with the required information</p>
  <form action='https://register-demo.freecodecamp.org'>
      <label for="first-name">Enter Your First Name: <input id="first-name" type="text" required /></label>
      <label for="last-name">Enter Your Last Name: <input id="last-name" type="text" required /></label>
      <label for="email">Enter Your Email: <input id="email" type="email" required /></label>
      <label for="new-password">Create a New Password: <input id="new-password" type="password" pattern="[a=z0-5]{8, }" required /></label>
    <input type="submit" value="Submit" />
/* file: styles.css */
body {
width: 100%;
height: 100vh;
margin: 0;
background-color: #1b1b32;
color: #f5f6f7;

label {
display: block;
margin: 0.5rem 0;

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Learn HTML Forms by Building a Registration Form - Step 22

Link to the challenge:

Hi @ruth0101.

This doesn’t match the string given in the question.

You wrote

[a=z0-5]{8, }

but the question asks you to write


Try matching it again and see the next hint :slight_smile:

Hope it helps :+1:

That was it. Thank you

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.