silverwolf-x's picture
download
raw
333 Bytes
export function parseUrlFromText(
text: string,
matcherFunc?: (text: string) => boolean
): string[] {
const linkRegex = /https?:\/\/[^\s/$.?#].[^\s)'"]*/gi
const links = Array.from(text.matchAll(linkRegex), (match) => match[0])
if (matcherFunc) {
return links.filter((link) => matcherFunc(link))
}
return links
}

Xet Storage Details

Size:
333 Bytes
·
Xet hash:
6d7e75866adb97d51b5e94f24820cfd9092e2a53d2979619977c24ad15506677

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.