Answers for "regexp extract part url"

1

use regex to get urls from string

/(?:(?:https?|ftp|file)://|www.|ftp.)(?:([-A-Z0-9+&@#/%=~_|$?!:,.]*)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:([-A-Z0-9+&@#/%=~_|$?!:,.]*)|[A-Z0-9+&@#/%=~_|$])/igm
Posted by: Guest on November-04-2020
0

javascript regex extract url from string

var urlRegex = /(https?://[^ ]*)/;

var input = "https://medium.com/aspen-ideas/there-s-no-blueprint-26f6a2fbb99c random stuff sd";
var url = input.match(urlRegex)[1];
alert(url);
Posted by: Guest on December-05-2020

Browse Popular Code Answers by Language