Skip to content

Commit

Permalink
fix: set to zero or one instead of any
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarjit committed Mar 25, 2024
1 parent 59e30d1 commit a78ebb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions golang/cmd/kafka-to-postgresql-v2/worker/topicProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
sharedStructs "github.com/united-manufacturing-hub/united-manufacturing-hub/cmd/kafka-to-postgresql-v2/shared"
)

// Test this regex at https://regex101.com/r/VQAUvY/5
var topicRegex = regexp.MustCompile(`^umh\.v1\.(?P<enterprise>[\w-_]+)\.((?P<site>[\w-_]+)\.)?((?P<area>[\w-_]+)\.)?((?P<productionLine>[\w-_]+)\.)?((?P<workCell>[\w-_]+)\.)?((?P<originId>[\w-_]+)\.)?_(?P<usecase>(historian)|(analytics))(\.(?P<tag>(?:[\w-_.]+\w)+))*$`)
// Test this regex at https://regex101.com/r/VQAUvY/6
var topicRegex = regexp.MustCompile(`^umh\.v1\.(?P<enterprise>[\w-_]+)\.((?P<site>[\w-_]+)\.)?((?P<area>[\w-_]+)\.)?((?P<productionLine>[\w-_]+)\.)?((?P<workCell>[\w-_]+)\.)?((?P<originId>[\w-_]+)\.)?_(?P<usecase>(historian)|(analytics))(\.(?P<tag>(?:[\w-_.]+\w)+))?$`)

func recreateTopic(msg *shared.KafkaMessage) (*sharedStructs.TopicDetails, error) {
topic := strings.Builder{}
Expand Down

0 comments on commit a78ebb2

Please sign in to comment.