Closed mchccn closed 3 years ago
I don't quite see how that command would give you over 10 arguments (example here: https://i.is-really.fun/180221_EiDfB.png ). I also used https://regexr.com/ to test out your regex but it only matches the first whitespace, not all the spaces between the arguments. Maybe a little mistake somewhere?
I see it now GitHub ignores all the spaces in between those args I see. In which case I agree that using a regex is better but still your regex still only registers the first space according to https://regexr.com/
nvm the test is flawed I tested locally it works :))
With this regex, you can parse arguments correctly. If I did
!help arg arg arg
it would've given me over 10 arguments, not 3. I have used \s+ as the regex to match all whitespace between arguments, and I have also used .shift() for more concise code.