new Vue({ el: "#app", data: { html: '<div><a href="http://www.domain.com" target="_blank"><img src="https://www.image.com/image.jpg" alt="a" /></a></div>', }, computed: { output() { let matched = []; const regex = /(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))*.)["']?/g; while ((m = regex.exec(this.html)) !== null) { matched.push(m); } return matched; } }, methods: {}, mounted() {} })