Learn Form Validation by Building a Calorie Counter - Step 24

Tell us what’s happening:

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

I have tried this but still it says, ‘You should pass “” as the second argument for replace’

Your code so far

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

/* file: styles.css */

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

function cleanInputString(str) {
  const regex=str.replace(regex/[+-" "]/g, "");
  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/127.0.0.0 Safari/537.36

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 24

Hi there. Please click reset.

After that, find the blank line in the editor.
Write your new line of code there.

The code should use the str and regex variables and should use the replace function.