Build a Calorie Counter - Step 24

Tell us what’s happening:

Good afternoon,

Currently I am studying JavaScript via FreeCodeCamp, but I got stuck.

Here is where I am:
Certified Full Stack Developer Curriculum > JavaScript > Form Validation > Workshop: Build a Calorie Counter > Step 24

I cannot find the solution, no matter how long I try different code solutions and stare at it.

Here is my code so far:

function cleanInputString(str) {
const regex = /[±\s]/g;
//regex = str.replace(regex, “”);
//return regex.replace(/regex/g, “”
return regex;
}

Your code so far

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

/* file: styles.css */

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

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

// 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/140.0.0.0 Safari/537.36

Challenge Information:

Build a Calorie Counter - Step 24
https://www.freecodecamp.org/learn/full-stack-developer/workshop-calorie-counter/step-24

you need to return str but changed, look carefully at where the string and the regex are in the example code, keep in mind that you have the variables str and regex to use