cleaning up regex for finding commands in the input buffer.