Extract URLs
Extracts all HTTP and HTTPS web URLs from a given input string.
extractURLs
The extractURLs function extracts all HTTP/HTTPS URLs from a given input string using a regular expression.
Function Signature
function extractURLs(str: string): string[]Parameters
str(string): The input string to parse.
Return Value
string[]: An array of URL strings found in the input. If none are found, returns an empty array.
Example Usage
playground.ts
Notes
- Designed to match common HTTP and HTTPS schemes.
- Does not validate the active availability or validity of the extracted links.
Last updated: Sun, Jun 14, 2026 07:06:16AM (UTC)
