I am looking for a jquery code to find the url part from a tweet and alert it. I have this tweet wrapped inside a div with a class .tweet
some tweet text goes here https://t.co/CTyPa0sYmp
I tried Regx expression but I guess because of the uppercase in url, it can only find the beginning of it.
var searchText = jQuery('.tweet').text(),
urls = searchText.match(/\b(https)?(:\/\/)?(\S*)\.(\w{2,4})\b/i);
alert(urls);
but the code only alerts "https://t.co"
What exactly am I doing wrong here?