let jsonp = 'success_jsonpCallback({"net": "内网"})' const reg = /^\w+\((\{[^()]+\})\)$/ let flag = null const match = jsonp.match(reg) if(match){ flag = JSON.parse(match[1]) } console.log(flag)