Regex Tuesday Challenge - Week Seven

The seventh regex tuesday challenge is to match valid domain names with protocols (http and https) in front of them and an optional slash (/) behind them. To keep it simple, you do not have to worry about special characters.

To test a regular expression on the test cases below, type it into the text input. Each test case will be marked as passed or failed respectively - you are aiming to get as many test cases as you can to pass. Note that JavaScript must be enabled for this feature to work. The regex engine used is the JavaScript regex engine; it is similar to PCRE, but with a few differences.

Test cases (0/41)

http://example.com/
match
https://example.com/
match
http://www.example.com/
match
http://example.org/
match
http://example.co.uk
match
http://bla.bla.biz
match
http://1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
match
https://boring.museum
match
http://lynx.io/
match
https://example.edu
match
http://example.gov/
match
http://sub.example.cd
match
https://personal.test.me
match
http://0test.com/
match
http://a.b
match
http://this-test.com
match
http://test.this-test.com/
match
http://this-test.test.com
match
http://TESTdomain.com
match
http://abcdefghijklmnopqrstuvwxyz.com
match
example.com
no match
www.example.com
no match
invalid://example.com
no match
httpd://example.com/
no match
ahttp://example.com
no match
javascript:alert()
no match
mailto:nobody@example.com
no match
http://test ing.com
no match
http://test'ing.com
no match
http://test_ing.com
no match
http://inval.id,com
no match
http://
no match
http://.com
no match
http://.....com
no match
http://example..com
no match
http://example.com.
no match
http://-example.com
no match
http://example-.com
no match
http://example.com-
no match
http://1234567890123456789012345678901234567890123456789012345678901234.com
no match (too long)
http://0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.com
no match (too long)
Congratulations, your regex passes all the test cases! Remember to share this challenge.