I am having trouble writing a simple command based system for a chatroom. I want users to be able to do chat actions such as
/j myChatRoom
or /join myChatRoom
/w user12 Hello
or /whisper user12 Hello
etc
I've spent a while and all I can come up with are crazy substring and indexof searches, trying to chop off pieces of the entire string and find a command and arguments. I feel like there could be a regex that could tell me if this string has one argument, for joining and leaving rooms, or two arguments, for private messages. I just can't think of a logical way.