chore: trash

This commit is contained in:
deepzz0 committed 2021-04-27 18:04:59 +08:00
1 parent 63b55b2df8
commit a39e3aac3b
8 files changed
+423 -26

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
// Package tools provides ...
package tools
import "regexp"
var regexpEmail = regexp.MustCompile(`^(\w)+([\.\-]\w+)*@(\w)+((\.\w+)+)$`)
// ValidateEmail 校验邮箱
func ValidateEmail(e string) bool {
return regexpEmail.MatchString(e)
}
var regexpPhoneNo = regexp.MustCompile(`^\+\d+$`)
// ValidatePhoneNo 校验手机号
func ValidatePhoneNo(no string) bool {
return regexpPhoneNo.MatchString(no)
}
// ValidatePassword 校验米阿莫
func ValidatePassword(pwd string) bool {
return len(pwd) > 5 && len(pwd) < 32
}