Learn localStorage by Building a Todo App - Step 67

Tell us what’s happening:

Why does this not work? Is there any different between A-z and A-Za-z?

Your code so far

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

/* file: styles.css */

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

const removeSpecialChars = (string) => string.replace(/^A-z0-9\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/131.0.0.0 Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 67

Hi there!

Use A-Z or a-z, don’t use uper/lowercase together. Also add the missing second value to the replace method

1 Like

Yes.
[A-Z] is equal to [ABCDEFGHIJKLMNOPQRSTUVWXYZ]
[a-z] is equal to [abcdefghijklmnopqrstuvwxyz]
[A-z] is equal to [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz]

There are more characters than letters in A-z, the ranges consider the unicode code

1 Like