preg_match('/^(http:\\/\/)?(.+)\.MYDOMAIN\.com(.*)/', $url, $match)
This is my regex to validate a URL that must have a sub-domain, but if someone uses www
instead of sub-domain it also gets validated. For example:
http://shoes.en.MYDOMAIN.com/This must passhttp://www.MYDOMAIN.com/This must fail
How can I edit my regex to fail if the sub-domain is www?
http://www.MYDOMAIN.com/. That will stop SO from linkifying them, and from dropping thehttp://in comments.