Handle https and http through regex