Skip to content

Commit

Permalink
refactor: change name
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed Mar 16, 2023
1 parent 71bb5f8 commit 419c5d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions config/regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
)

var (
RegexEmailWeak = regexp.MustCompile(`.+@.+\..+`) // https://davidcel.is/posts/stop-validating-email-addresses-with-regex/
RegexHostname = regexp.MustCompile(`^[a-zA-Z]([a-zA-Z0-9\-]+[\.]?)*[a-zA-Z0-9]$`) // https://tools.ietf.org/html/rfc952
RegexCharsAlnum = regexp.MustCompile(`^[a-zA-Z0-9]+$`)
RegexCharsNumeric = regexp.MustCompile(`^[0-9]+$`)
RegexCharsAlpha = regexp.MustCompile(`^[a-zA-Z]+$`)
RegexUUID = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
RegexMD5 = regexp.MustCompile(`^[0-9a-f]{32}$`)
RegexEmailWeak = regexp.MustCompile(`.+@.+\..+`) // https://davidcel.is/posts/stop-validating-email-addresses-with-regex/
RegexHostname = regexp.MustCompile(`^[a-zA-Z]([a-zA-Z0-9\-]+[\.]?)*[a-zA-Z0-9]$`) // https://tools.ietf.org/html/rfc952
RegexAlnum = regexp.MustCompile(`^[a-zA-Z0-9]+$`)
RegexNumeric = regexp.MustCompile(`^[0-9]+$`)
RegexAlpha = regexp.MustCompile(`^[a-zA-Z]+$`)
RegexUUID = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
RegexMD5 = regexp.MustCompile(`^[0-9a-f]{32}$`)
)
2 changes: 1 addition & 1 deletion rule/alnum.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import (

const NameAlnum Name = "alnum"

var Alnum = Match(NameAlnum.String(), config.RegexCharsAlnum)
var Alnum = Match(NameAlnum.String(), config.RegexAlnum)
2 changes: 1 addition & 1 deletion rule/alpha.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import (

const NameAlpha Name = "alpha"

var Alpha = Match(NameAlpha.String(), config.RegexCharsAlpha)
var Alpha = Match(NameAlpha.String(), config.RegexAlpha)
2 changes: 1 addition & 1 deletion rule/numeric.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ const (
NameNumeric Name = "numeric"
)

var Numeric = Match(NameNumeric.String(), config.RegexCharsNumeric)
var Numeric = Match(NameNumeric.String(), config.RegexNumeric)

0 comments on commit 419c5d5

Please sign in to comment.