javascript get string from url code example Example: extract urls from string javascript //use the regex let url = string.match(/\bhttps?:\/\/\S+/gi);