MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / checkIpPattern

Function checkIpPattern

core/init/validator/validator.go:67–74  ·  view source on GitHub ↗
(fl validator.FieldLevel)

Source from the content-addressed store, hash-verified

65}
66
67func checkIpPattern(fl validator.FieldLevel) bool {
68 value := fl.Field().String()
69 result, err := regexp.MatchString(`^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$`, value)
70 if err != nil {
71 global.LOG.Errorf("regexp check ip matchString failed, %v", err)
72 }
73 return result
74}
75
76func checkPasswordPattern(fl validator.FieldLevel) bool {
77 value := fl.Field().String()

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected