RegEx to validate URL patterns
I need help with a regular expression to validate any of the following URL patterns. The * is a wildcard.
https://google.com
https://www.google.com
https://www.google.com/*
https://*.google.com/
https://*.google.com/asdasdas/*
So far I have this:
https:\/\/(w{3}|\*)?(?:\.[\w\.-]+){2,}[\w\-\._~:/?#[\]@!\$&'\(\)\?:(*)\+,;=.]+$
But is failing on the first case, a domain pattern without "www" or "*" before the first dot.
Keep in mind that instead of google.com it could be any domain.