Test
func TestGetVaild(t *testing.T) {
str:="zxtestcv,Vaild[Email;Min(120)]()][fdwd]"
var reg = regexp.MustCompile(`Vaild\[(.*?)]`)
params:=reg.FindStringSubmatch(str)
for _,param :=range params {
t.Log(param)
}
}
测试结果:
=== RUN TestGetVaild
--- PASS: TestGetVaild (0.00s)
utils_test.go:16: Vaild[Email;Min(120)]
utils_test.go:16: Email;Min(120)
PASS
Process finished with exit code 0
网友评论