Tell us what’s happening:
I’m really struggling with my regex expression, from my understanding, everything inside the square brackets should be accepted, the “g” means it should check the whole string, and everything else should be removed.
Any pointers on where I’m going wrong?
Regex is really frying my brain!
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const removeSpecialChars = ((str) => {
str = str.replace(/[A-Za-z0-9\ ]/g, "");
return str;
});
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Challenge Information:
Learn localStorage by Building a Todo App - Step 67