I have a HTML source as input and would like to know what CMS the website is made in.
Many CMS leave their name in a meta tag like this:
<meta name="Generator" content="MY CMS" />
I can get the result like this:
Match match = Regex.Match(html, ".*(?i)meta.*generator.*");
match = Regex.Match(match.ToString(), "content.*\".*\"");
match = Regex.Match(match.ToString(), "\".*\"");
Gives me “MY CMS”
But is there any way to shorten it down to one Regex.Match?
Please notice, that the meta tag could be like this:
<meta content="MY CMS" name="Generator" />
Thanks and best regards
Try the following:
The value is in group 1.
Hope it helps.