正则表达式 2017123456789 2018-03-06 226 阅读1分钟 1.获取括号内内容/\(([^)]*)\)/.exec(result)2.空格分隔'124235ewfdgdfhrtht'.toString().replace(/(.)(?=(?:.{4})+$)/g,'$1 ')3.获取url参数let ret = location.search.match(new RegExp('(\\?|&)' + key + '=(.*)(&|$)')) return ret && decodeURIComponent(ret[2])