Learn Form Validation by Building a Calorie Counter - Step 31

Tell us what’s happening:

In my code I am not getting what mistake I am making

Error shows that :

Sorry, your code does not pass. Don’t give up.

You should add the [0-9] character class before e in your regular expression.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function isInvalidInput(str) {
   const validRegex = /[0-9]e[0-9]/i;
}

// User Editable Region

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 31

The code looks correct. Can you reset the step and try it again to see if anything changes?

I did!

Still it shows

Sorry, your code does not pass. Keep trying.

You should add the [0-9] character class before e in your regular expression.

Hi there!

Try to clear your browser cache or change the browser for the challenge step.