Skip to content

Commit

Permalink
正規表現を強化
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih committed Jul 14, 2024
1 parent 8c97eae commit 1c7b9c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/scripts/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export function appendQuery(url: string, query: string): string {
}

export function extractDomain(url: string) {
const match = url.match(/^(https?)?:?\/{0,2}([^\/]+)/);
const match = url.match(/^(?:https?:)?(?:\/\/)?(?:[^@\n]+@)?([^:\/\n]+)/im);
return match ? match[2] : null;
}

0 comments on commit 1c7b9c7

Please sign in to comment.