diff options
Diffstat (limited to 'internal/consts/consts.go')
-rw-r--r-- | internal/consts/consts.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/consts/consts.go b/internal/consts/consts.go index 8a22e5825..34f810727 100644 --- a/internal/consts/consts.go +++ b/internal/consts/consts.go @@ -20,6 +20,8 @@ // Don't judge me. package consts +import "regexp" + // Flags is used for storing the names of the various flags used for // initializing and storing urfavecli flag variables. type Flags struct { @@ -65,3 +67,6 @@ func GetEnvNames() Flags { DbDatabase: "GTS_DB_DATABASE", } } + +var IPV4Regex = regexp.MustCompile(`^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`) +var HostnameRegex = regexp.MustCompile(`^(?:[a-z0-9]+(?:-[a-z0-9]+)*\.)+[a-z]{2,}$`) |