mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-05 15:06:50 +08:00
10 lines
188 B
Go
10 lines
188 B
Go
package validx
|
|
|
|
import "regexp"
|
|
|
|
// IsPostalCode 验证是否为邮编号码
|
|
func IsPostalCode(str string) bool {
|
|
reg := regexp.MustCompile(`^[1-9]\d{5}$`)
|
|
return reg.MatchString(str)
|
|
}
|