Helpers

findURLsInString.mjs

@mr_ozio/scraper-utils · v2.5.0 · Generated April 21, 2026

Target Style

Target Style

1 exports

const

urlsIn

Target Style
export const urlsIn = (string) => [...(string.match(regex) || [])]

Finds URLs in a string with a shorter, more natural name.

Target style API. Preferred for new code.

Parameters

  • stringstring

Returns

string[]

Legacy Style

Legacy Style

1 exports

const

findURLsInString

Legacy Style
export const findURLsInString = (string) => urlsIn(string)

Finds URLs in a string.

Legacy API. Kept for older code and not the preferred choice for new code.

Parameters

  • stringstring

Returns

string[]

Example

const links = urlsIn('Open https://example.com and tg://resolve?domain=test')