//Remove Html code from string
var textString = code.replace(/<\/?[^>]+(>|$)/g, " ").replace(/^( |nbsp;)+/g, '').trim(); //Match full url and generate a array
var urls = textString.match(/\b(http(s)?(:\/\/))?(www.)?[a-zA-Z0-9-_.]+(.[a-zA-Z0-9]{2,}).*?(\.\w+)([-a-zA-Z0-9:%_+.~#?&\/\/=]*)/ig);
//Remove content before http var url = /http(.+)/.exec(urls[0])[0];
No comments:
Post a Comment