simplify regexes by using backquoted strings to avoid double escapes

This commit is contained in:
Matt Jaffee 2018-05-15 11:05:36 -05:00
parent c543831937
commit 8ae170ac6c
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

4
uri.go
View file

@ -26,8 +26,8 @@ import (
)
var schemeRegexp = regexp.MustCompile("^[+a-z]+$")
var hostRegexp = regexp.MustCompile("^[0-9a-z.-]+$|^\\[[:0-9a-fA-F]+\\]$")
var addressRegexp = regexp.MustCompile("^(([+a-z]+):\\/\\/)?([0-9a-z.-]+|\\[[:0-9a-fA-F]+\\])?(:([0-9]+))?$")
var hostRegexp = regexp.MustCompile(`^[0-9a-z.-]+$|^\[[:0-9a-fA-F]+\]$`)
var addressRegexp = regexp.MustCompile(`^(([+a-z]+):\/\/)?([0-9a-z.-]+|\[[:0-9a-fA-F]+\])?(:([0-9]+))?$`)
// URI represents a Pilosa URI.
// A Pilosa URI consists of three parts: