如何通过正则匹配出所有的name的value值
const str = '[{"id":"1","name":"t1","children":[{"id":"1","name":"t1-1","children":[]}]},{"id":"1","name":"t2","children":[]}]'; str.match(...)
想要的结果(Array): ['t1', 't1-1',t2]
['t1', 't1-1',t2]
后行断言:/(?<="name":")([^"])+/g
/(?<="name":")([^"])+/g
1.4m articles
1.4m replys
5 comments
57.0k users