Slightly refactored extractNicknameFromRegularMessage function.