Learn Form Validation by Building a Calorie Counter - Step 24

Tell us what’s happening:

I have been at this for 25 min and AI says it is right. What is the problem

Your code so far

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

/* file: styles.css */

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

function cleanInputString(str) {
  return str.replace(/[+-\s]/g, "");
}

// 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/138.0.0.0 Safari/537.36 Edg/138.0.0.0

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 24

hi there,

Please note that the AI is not familiar with the fCC curriculum so you may want to avoid asking it for help with it.

What hint or error are you getting from the step?

1 Like

Use your regex

Where is the regex variable?

1 Like

Thank you for your time, much appreciated!. AsI suspected, something “buggy” was going on which happens from time to time, specially when you try and cut and paste. I used to drive myself mad but now if I am really stuck I will refresh or reset.
I couldn’t disagree with you more about using AI. I disagree with AI, I think we have a world of trouble on its way not even talking about the unforseen consequences. for any one good thing coming from it there will be 3 bad things. But since it is here, i’m using it and it has been an invaluable help to me, like a tutor but better sometimes. No more going in circles and searching, it teaches you exaclty what you want and need. and its not “giving you the answer”, it allows me to frame my questions to undertand the logic and bigger picture and it is just simply amazing!!

i’m glad you worked things out. Perhaps you will see my point about AI later on in your journey. In all cases, we will be around.