I hope this will help you get toward your goal. I made a regex, that matches what the browser is outputting (the rgb is just the hex as an rgb). It may need to be updated since I didn't test it in all browsers, but I think it converts it to rgb so if there is an alpha, that can be handled easily.
Here's the fiddle: http://jsfiddle.net/HQ7NF/2/
And here's the regex I am using:
var reBoxShadow = /(?:rgb\((\d+), ?(\d+), ?(\d+)\)([^,]*))+/g;
while ( style = reBoxShadow.exex(element.style.boxShadow) ) {
/* this is where stuff happens */
}
I then split the color and the args into separate variables, so you can decide what to do with them. I hope that can at least get you on the right track.