exec() 方法用于检索字符串中的正则表达式的匹配。
前端开发时用mockjs,请求带参数的api时可以用
RegExpObject.exec(string)
//string 要被检索的字符串
//RegExpObject希望检索到的对象
let url = 'http://172.31.231.91:8080/api/basedata/equipmentdata/info?id=888888'
let id = /([^d=]+)$/.exec(url) //匹配‘d=’后面的字符串
console.log(id)
//结果 888888