📅  最后修改于: 2022-03-11 15:03:55.144000             🧑  作者: Mango
let pattern = "/used-cars///-cars-for-sale"
let matches = pattern.match(/<.+?>/g);
const newArray = matches.map((match) => match.replace(/[<>]/g, ''));
let object = {};
newArray.map((item, index) => {
object[item] = '';
});
console.log(object)