Following on from a post I made earlier, I am making progress with what I require, but not knowing much about how RegEx expressions work, I'm stuck!
This line:
FilesM = Regex.Matches(StrFile, "<link.*?href=""(.*?)"".*? />")
Is extracting from the HTML of my page, all <link..
elements to compile a combined style
file.
However, I need to exclude any media="print"
links.
I am also trying to combine JS scripts
FilesM1 = Regex.Matches(StrFile, "<script.*?src=""(.*?)"".*?></script>")
Does this, but in this case, I want to exclude any scripts which are not hosted locally. I'd like to do this by excluding any scripts where the href
starts with "http"
So how would I exclude these two cases from the match collection?