r.ParseForm()
phone := r.Form.Get(“phone”)
//value1 := “[1,2]”
//pattern := (\[|\()?((\d+(\.\d+)?)|\-)?\,(\s)*((\d+(\.\d+)?)|\+)?(\]|\)?)
matched1 := false
//matched1, err := regexp.MatchString(phone,pattern)
compiler, err := regexp.Compile("[\(\[][0-9]+(\.[0-9]+)?,[0-9]+(\.[0-9]+)?[\)\]]")
if err != nil {
panic(err)
}
result := compiler.FindAllString(phone, -1)
//fmt.Println(matched1,err)
fmt.Println(result)
if len(result) > 0 {
matched1 = result[0] == phone
}