I was wondering if anyone there could help me with regex in C #. I think it's pretty simple, but I waved my brain and am not quite sure why it is so hard for me. :)
I found some examples, but I can not manipulate them to do what I need.
I just need to match ANY alphanumeric string of subdomains + dashes, which is not "www", and just before "."
Also, ideally, if someone were to type “www.subdomain.domain.com”, I would like www to be ignored if possible. If not, this is not a problem.
In other words, I would like to match:
- (test) .domain.com
- (test2) .domain.com
- (wwwasdf) .domain.com
- (asdfwww) .domain.com
- (w) .domain.com
- (WWWWWW) .domain.com
- (asfd-12345-www-bananas) .domain.com
- WWW. (subdomain) .domain.com
And I do not want to match:
It seems to me that this should be easy, but I have problems with the "do not match" part.
What it costs for is to use the IIS 7 URLs in the Rewrite module to rewrite for all non-existent subdomains.
Thanks!
source share