I want to adapt a html string with a PowerShell script. The URL to a cascading style sheet shall be replace to a local CSS file. I use this replace command with a regular expression. But the result is not as expected.
$a = '<link rel="stylesheet" type="text/css" href="https:/my.web.site/c5fb04c9-44e6-40d1-bb1f-46b170a9e53f" id="style-standard" />'
$b = $a.Replace('href="(.*?)", '$1.css')
The attributes of the LINK item can occur in any order.
How can I fix the search expression so, that the parentheses capure the GUID in the input?