Seeking guidance on isolating the width attribute in CSS:
oldStyle = "width:90%;height:inherit;padding-right: 15px;padding-left: 15px;margin-right: auto;margin-left: auto;"
Considering this code snippet:
oldStyle.replace(new RegExp("width:[0-9]+%;.*$", "g"), "width:25%;")
However, the output yields only:
"width:25%;"
The desired outcome should be:
"width:25%;height:inherit;padding-right: 15px;padding-left: 15px;margin-right: auto;margin-left: auto;"
How can I modify solely the width component of the CSS while preserving the remaining styles?