So I am writing a little snippet to identify a wordpress site first by regex then will try accessing the login page etc.
Could this be optimized any better? Should I account for blank spaces in between attributes?
Regex wordPressPattern = new Regex("(<meta name="generator" content="WordPress)| (Powered by <a href="http://www.wordpress.org")+", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline);
A few improvements:
+
at the end because that doesn’t make sense("|')
name="generator"
I think it isn’t relevant so we’ll use.*?
and add[^>]*>
at the endTo sum it up: