package main import ( "fmt" "regexp" "testing" ) func TestVerify(t *testing.T) { // 输入的JSON字符串 data := `{"id":"071995171560000000c40808","status":"highspeed","speed1":"35","speed2":"0","realtime":"2025-6-18 10:11:25","audio":"[m1]���ѳ��٣�������","vol":"6","play":"run","dis_content":"[pic3]#[pic4]","workmode":"normal"}` // 使用正则表达式提取 "speed1" 后面的数字 re := regexp.MustCompile(`"speed1":"(\d+)"`) match := re.FindStringSubmatch(data) speed1 := match[1] fmt.Println("Speed1:", speed1) }