Files
go-easy-utils/validUtil/other_number.go
T
2023-03-12 19:15:32 +08:00

10 lines
191 B
Go

package validUtil
import "regexp"
// IsPostalCode 验证是否为邮编号码
func IsPostalCode(str string) bool {
reg := regexp.MustCompile(`^[1-9]\d{5}$`)
return reg.MatchString(str)
}