You are correct, perhaps I should have been more clear. The regex that we were discussing ends with \s*?(.*?)$/; which is somewhat different from your example. Here it is matching the fewest spaces followed by the fewest 'anything but newlines' to the end of the string. Since the . will match white space, the \s*? will match nothing. Always. But thank you for your clarification of the more generic case.
Good point! I confess that I hadn't seen that. I'm not exactly a slouch when it comes to regex but it seems like every week I come across a new case whose functionality I'll miss if I don't take a second to look at it more carefully. Gotta love regex!