Changed Kafka topic name validation (#1051)

* Changed Kafka topic name validation so that capital characters are also allowed
* Removing support for \ in Kafka topic name
* Using raw string some specific sequences
This commit is contained in:
Vishal
2019-01-14 19:23:06 +08:00
committed by Ta-Ching Chen
parent 37f37c0b8b
commit 89081b087b
+2 -1
View File
@@ -36,7 +36,8 @@ const (
var (
validAzureQueueName = regexp.MustCompile("^[a-z0-9][a-z0-9\\-]*[a-z0-9]$")
validKafkaTopicName = regexp.MustCompile("^[a-z0-9][a-z0-9\\-._]*[a-z0-9]$")
// Need to use raw string to support escape sequence for - & . chars
validKafkaTopicName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-\._]*[a-zA-Z0-9]$`)
)
type (