Skip to content

Commit

Permalink
Merge pull request #997 from cassidykelly/escape-periods-in-version-r…
Browse files Browse the repository at this point in the history
…egex

Escape periods in Kafka version regex
  • Loading branch information
eapache authored Dec 5, 2017
2 parents 66fbffd + 84e6098 commit 703eaab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ func ParseKafkaVersion(s string) (KafkaVersion, error) {
var major, minor, veryMinor, patch uint
var err error
if s[0] == '0' {
err = scanKafkaVersion(s, `^0.\d+.\d+.\d+$`, "0.%d.%d.%d", [3]*uint{&minor, &veryMinor, &patch})
err = scanKafkaVersion(s, `^0\.\d+\.\d+\.\d+$`, "0.%d.%d.%d", [3]*uint{&minor, &veryMinor, &patch})
} else {
err = scanKafkaVersion(s, `^\d+.\d+.\d+$`, "%d.%d.%d", [3]*uint{&major, &minor, &veryMinor})
err = scanKafkaVersion(s, `^\d+\.\d+\.\d+$`, "%d.%d.%d", [3]*uint{&major, &minor, &veryMinor})
}
if err != nil {
return minVersion, err
Expand Down

0 comments on commit 703eaab

Please sign in to comment.