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.
我有这个字符串
var newtypegraph=newtypegraph.replace(' "type":"bar3d" ',' "type":"area" ');
我想将 bar3d 设为通配符。
这看起来像 JavaScript,所以你可以使用正则表达式:
var newtypegraph = newtypegraph.replace(/"type":".*?"/g, '"type":"area"');
这看起来像 JSON 对象的属性。这是 JSON 吗?