Hey all I have a large html string like
<a style="background: rgb(100, 101, 43) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-backg round-inline-policy: -moz-initial;" href="#">swatch4</a>
<a style="background: rgb(34, 68, 33) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-b ackground-inline-policy: -moz-initial;" href="#">swatch5</a>
<a style="background: rgb(11, 38, 68) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -m oz-background-inline-policy: -moz-initial;" href="#">swatch6</a>
<a style="background: rgb(39, 11, 60) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial ; -moz-background-inline-policy: -moz-initial;" href="#">swatch7</a>
...There are lot of these entries...
What I would like to end up with is a php array
$colors = array(
'rgb(34, 34, 33)',
'rgb(11, 38, 68)',
...
);
etc.
The step I need help with extracting the rgb part of the string. I am having trouble with my regexs eating too much of the string. Anyhelp would be appreciated, i would like to get this down and learn how to do (as opposed to just having it done). I am using vim btw.
Thanks