diff --git a/shared/utils.ts b/shared/utils.ts index 00ed0c9..468700d 100644 --- a/shared/utils.ts +++ b/shared/utils.ts @@ -21,7 +21,7 @@ type URLPatternGroups = { export function urlFromWildcardHref(input: string) { const pattern = new RegExp( '^' - + '(?:(?[^:/?#.]+:)(?://)?)?' // protocol, optionally match '//' + + '(?:(?[^:/?#]+:)(?:///?/?)?)?' // protocol, optionally match '//(/)' + '(?:' // wrap host portions in an optional match, allows matching path/query/hash only + '(?:(?[^\\\\/?#]*)@)?' // username+password + '(?[^\\\\/?#:]*?)' // hostname