(JavaScript) I am working with an html email template stored as a string. Is there a way to extract all the inline styles used in the template? For instance, if I have this input:
<div style="min-width:300px;max-width:600px;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;margin:0 auto;" align="center">
<div style="margin: 0 auto;padding: 20px;">
<a href="/" style="text-decoration: none;">
<img src="https://i.ibb.co/KXYtCNT/Logo-wellness-w.png" alt="" width="84px" />
</a>
</div>
</div>
I would like the output to be ['min-width','max-width','overflow-wrap','word-wrap','word-break','margin','padding','text-decoration']
I believe using Regex would be the most efficient way, but I am unsure of the exact syntax. I attempted this for tags:
const tagRegex = /<\/?[\w\d]+>/gi;
and this for styles but couldn't get it to work:
const styleRegex = /(.*?)+:[\w\d]+;/;