Regex for URL (http/https)

Matches an http or https web URL.

^https?://[^\s/$.?#].[^\s]*$

Proof it works

5/5 sample tests passed · compiles: true

SampleShould matchResult
https://example.com yes pass
http://a.co/path?x=1 yes pass
ftp://example.com no pass
example.com no pass
http:// no pass

Try your own input

Related patterns