Looks like you made a typo.

Also, a regex like might be DRYer here if you're into that kind of thing:

    1.9.3-p374 :001 > 'https://example.com'.match(%r[\Ahttps?://])
     => #<MatchData "https://">
    1.9.3-p374 :002 > 'http://example.com'.match(%r[\Ahttps?://])
     => #<MatchData "http://">
    1.9.3-p374 :003 > 'example.com'.match(%r[\Ahttps?://])
     => nil