asp.net mvc 5 - MVC Model Validation RegEx -
I need a regex to validate without a domain name http: // or https: //
What do I mean:
Be valid:
domain.com domain.fr domain.it domain.whateverelse subdomain.domain.com subdomain. Doamin.fr Subdomain.domain.whateverelse should be invalid:
domain http://domain.com https://domain.com https: // domain .whateverelse http://subdomain.domain.com http://subdomain.domain.fr http: //subdomain.domain.whateverelse This is what I have I have come to: ] *)? For example, above regex considers domain.whatever regards as invalid ... then basically works just with .com
It looks a lot better:
(http | ftp | https): \ / \ [\ w \ -_] + (\ . [\ W \ -_]) + ([\ w \ - \, @ ^ =% & amp;::.? ~~ + # +] * * [\ w \ - \ @ ^ =% & amp; ; Amp; / ~ \ + #])? Coming from : where a lot can be found;)
Comments
Post a Comment