After finding this solution useful,
split string only on first instance of specified character
I'm confused at how this actually works. One top comment explains, "Just to be clear, the reason this solution works is because everything after the first _ is matched inside a capturing group, and gets added to the token list for that reason." - @Alan Moore
That doesn't make sense to me; what's a "capturing group"? Additionally, the author's positive-rated solution,
"good_luck_buddy".split(/_(.+)?/)[1]
"luck_buddy"
is being noted in the comments as having an improved method by omitting the question mark, ?,
split(/_(.+)/)
or omitting the question mark and replacing the plus sign, +, with an asterisk, *.
split(/_(.*)/)
Which is actually the best solution and why? Thank you.