Extract Number inside a String

HI

I have the following string that is loaded from an API in a External site.

var myString:String = ‘code=“33”, format=“jpg”’;

How can I extract the 33 or the JPG inside the String. I know the String format is always the same, only the values are changed time to time. I need to extract does values dynamicaly.

thanks