如何通过正则匹配出所有的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
2.1m questions
2.1m answers
60 comments
57.0k users