mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2026-04-23 00:07:09 +08:00
10 lines
191 B
Go
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)
|
|
}
|