摘要:
function deepGet(object, path, defaultValue) { return (!Array.isArray(path) ? path.replace(/\[/g, '.').replace(/\]/g, '').split('.') : path) .reduce((o, k) => (o || {})[k], object) ||... 阅读全文
摘要:
{[^}]+} var str = "aa ds sdf {asdf asdfag }"; var str1 = str.match(/\{[^\}]+\}/)[0]; /{[\S\s]+}/或者/{(.|\r\n)+}/ *注:\S\s可是微软文档中对\n匹配的标准用法哦 var str = "aa ds sdf {asdf asdfag }"; var str1 = str.m... 阅读全文