Learn Form Validation by Building a Calorie Counter - Step 32

I tried a lot to get out of this step but all in vain
help to solve that
Number inputs only allow the e to occur between two digits. To match any number, you can use the character class [0-9]. This will match any digit between 0 and 9.

Add this character class before and after e in your pattern.

function isInvalidInput(str) {
  const regex = /[0-9]/i;
}
code link:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-form-validation-by-building-a-calorie-counter/step-32

This line shows three things it wants you to do:
before, after and e

i added as regex = /e[0-9]e/i; . but this is still not working

Look at this line again

Thank you so much ! Solved

My pleasure. Don’t forget to mark my answer as the solution and then you can close this thread

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