Question mark with the colon (?:) in solution 2

Continuing the discussion from freeCodeCamp Challenge Guide: Spinal Tap Case:

In solution 2, what is the difference between .split(/(?:_| )+/) and .split(/(_| )+/)?

I understand that the question mark whith the colon (?: ) means that the group is matched but is not captured for back-referencing, but i don’t see the point of it in this solution. Somebody can helpme to understand this?

Thanks in advance.

Try them both in the terminal or a service like repl and see the difference it makes. :wink: I bet that you can work through it with some fiddling, but definitely let us know if that doesn’t help.

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