function isValidSubscriptionTopic(topic) {
        return /^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/.test(topic);
    }
Test a topic string is valid for subscription
@param {string} topic
@returns `true` if it is a valid topic