← Back to challenges

RegEx: Character Classes IX ⁠- \w

JavaScriptHardregexstrings

Instructions

You can think of character classes as characters with special meaning. They are recognized as special when you place the \ before the character.

Here is a list of the character classes in JavaScript:

., \cX, \d, \D, \f, \n, \r, \s, \S, \t, \v, \w, \W, \0, \xhh, \uhhhh, \uhhhhh, [\b]

There is a hidden word in this string:

const str = "**^&$Regular#$%Expressions$%$$%^**"

Write the regular expression that reveals the hidden word. You have to remove all of the special characters to reveal the word. Use the character class \w in your expression.

Notes

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Product Divisible by Sum?