URL
Matches HTTP/HTTPS URLs
Pattern
https?:\/\/[\w\-]+(\.[\w\-]+)+[\w\-.,@?^=%&:/~+#]*
Matching examples
https://example.comhttp://sub.domain.com/pathNon-matching examples
ftp://filenot-a-urlBreakdown
- https?:
- http or https
- \/\/
- Literal //
- [\w\-]+
- Hostname
- (\.[\w\-]+)+
- Domain parts
- [\w\-.,@?^=%&:/~+#]*
- Path and query