Tell us what’s happening:
Describe your issue in detail here.
Why my this code is not working I have tried to replace characters between small letters and capital letters
**Your code so far**
function spinalCase(str) {
// "It's such a fine line between stupid, and clever."
// --David St. Hubbins
console.log(str
.replace(/(?<=[a-z])\s+|_+|(?=[A-Z])/g,"-")
.toLowerCase())
return str
.replace(/(?<=[a-z])\s|_|(?=[A-Z])/,"-")
.toLowerCase();
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 OPR/79.0.4143.72
Challenge: Spinal Tap Case
Link to the challenge: