Golang之使用正则表达匹配小时数

匹配小时数的正则,能够匹配小时数 01,02,03,…,23

^(([0-1]\d)|(2[0-3]))

Golang调用正则匹配

regex := `^(([0-1]\d)|(2[0-3]))`
flag, err := regexp.MatchString(regex, maintenanceStartTime.Value)
发布了204 篇原创文章 · 获赞 59 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/baidu_34122324/article/details/102524436