定义一个正则表达式:
var reg = /^\w+\(({[^()]+})\)$/
var mstches = ret.match(reg)
if(matches){
ret = JSON.parse(matches[1])
// matches[0]为整个字符串
// matches[1]为匹配到的分组
}
定义一个正则表达式:
var reg = /^\w+\(({[^()]+})\)$/
var mstches = ret.match(reg)
if(matches){
ret = JSON.parse(matches[1])
// matches[0]为整个字符串
// matches[1]为匹配到的分组
}
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。