I'm trying to extract automatically the part of the tag's style from div html. I have 100 style combinations, so doing it manually is not possible. This is the path html style tags --> css
.rule1 {
background-color: rgb(196, 0, 143);
}
.rule {
background-color: rgb(230, 176, 18);
}
<div class="line line--big line--active" role="button"
style="background: rgb(196, 0, 143) none repeat scroll 0% 0%; color: white; opacity: 1;"><span>1</span></div>
<div class="line line--big line--active" role="button"
style="background: rgb(230, 176, 18) none repeat scroll 0% 0%; color: white; opacity: 1;"><span>5</span></div>
Attention: this question is not duplicate because i don't have in my code the style tag. I already searched for other answers but they zurb link is down now http://zurb.com/ink/inliner.php here you need the style tag: JavaScript Regex to Extract Text from Style HTML Tags and also here: Convert css from html style tag into inline css