Regular expression test

why is my code not passing??re
**Tell us what's happening:**
Describe your issue in detail here.

       **Your code so far**

function splitify(str) {
 // Only change code below this line
return str.split(/\d/);

 // Only change code above this line

splitify("Hello World,I-am code");

   **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0

Challenge: Split a String into an Array Using the split Method

Link to the challenge:

\d indicates digits. The example in the challenge tries to split by digits. But here we want to split on either space or special characters like comma, dot, hyphen.

So you need a different regex for that.

i have tried this (" - ") and is not passing

/\W/ i figgured it out thanks alot

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.