URL

Matches HTTP/HTTPS URLs

Live Tester— test the URL pattern
Pattern/https?:\/\/[\w\-]+(\.[\w\-]+)+[\w\-.,@?^=%&:/~+#]*/

Should match →

Should not match →

Pattern

https?:\/\/[\w\-]+(\.[\w\-]+)+[\w\-.,@?^=%&:/~+#]*

Matching examples

https://example.comhttp://sub.domain.com/path

Non-matching examples

ftp://filenot-a-url

Breakdown

https?:
http or https
\/\/
Literal //
[\w\-]+
Hostname
(\.[\w\-]+)+
Domain parts
[\w\-.,@?^=%&:/~+#]*
Path and query

Related tools

Other patterns