Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有类似的数据
[{somevalue1},{somevalue2}]
我想提取datawithin大括号
datawithin
我用了
var data = data.match(/[{][^\"]+[}]/g);
但我收到了null价值。
null
你可以使用这个:
data = data.match(/\{([\w\s]*)\}/g);
\w 将查找字母数字,\s 查找空格。
data=data.match(/\{([^}]*)\}/g);