I want to match a specific subdomain but any domain using regex.
Exemple :
- http://webmail.domain1.com => MATCH
- http://webmail.domain2.net => MATCH
- http://webmail.domain3.de => MATCH
- http://www.domain1.com => DON’T MATCH
- http://some.domain2.be => DON’T MATCH
- http://another.domain3.com => DON’T MATCH
I also need in that regex match to get a matching group with the rest of the querystring :
http://webmail.domain1.com/default.aspx?q=1&p=2
- Group 1 : http://webmail.domain1.com => this MUST match
- Group 2 : default.aspx?q=1&p=2
Here you go:
Test here: http://rubular.com/r/rVu8zYHCE7
Here is one that isn’t specific to
.com: