Tell us what’s happening:
My question here is simple.It seems that i didn’t get something right on the regex lesson.Why here i solved the challenge using in the split method this /(?=[A-Z])|_|\s/
and i couldn’t solved with this /(?=[A-Z])|(?=_)|(?=\s)/
.
Thanks!
Your code so far
function spinalCase(str) {
str=str.split(/(?=[A-Z])|_|\s/);
console.log(str);
return str;
}
spinalCase('This Is Spinal Tap');
spinalCase("AllThe-small Things")
spinalCase("The_Andy_Griffith_Show");
spinalCase("Teletubbies say Eh-oh");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36
.
Challenge: Spinal Tap Case
Link to the challenge: