Can anyone shed some light on why do you need a capture group here im truly lost as hell

function spinalCase(str) {


 return str
   .split(/\s|_|(?=[A-Z])/) 

/*  
.split(/\s|_|?=[A-Z]/) 
like this doesnt work
*/
   .join("-")
   .toLowerCase();
}

// spinalCase("This Is Spinal Tap") should return "this-is-spinal-tap".

Why do you have the lookahead there?