dim html as String = backen
dim theRegex as new RegEx
theRegex.options.greedy = False
theRegex.Options.TreatTargetAsOneLine = True
theRegex.Options.DotMatchAll = True
'remove external css
theRegex.searchPattern = "(?i)<link[^>]+href\s*=\s*['""](.*?css.*?)['""][^>]*>"
theRegex.ReplacementPattern = ""
Html = theRegex.Replace(html)
me.LoadPage(html, nil)
Looks like the pattern *? toggles the Option.Greedy option, rather than setting greedy to false as one would expect.
So, if you remove the two ? from your pattern and add the Option.ReplaceAllMatches = True it works as intended. Or don’t set the Option.Greedy but add anaother ? after the last * in the pattern.