Try this, it's untested but should work. If you're familliar with regex's you should recognise the syntax anyway. Note I've changed your double quotes to single for the purpose of containing it within another string.
var text="<img ... src='http://example.com/wigget/red-wigget.jpg' ...>";
text.replace( /^.*src='(.*?)'.*$/, "$1");
You can easily change src to value for the second one, or if you need to use it a lot, use a universal function to extract the parameter you want.