Question: I am extracting url from tweets:

sample twitts are:

```
\'Whn I ws calld for ths song @VishalDadlani @5hekhar both said \"we finally hv the perfect song for u\" lulz http://t.co/6vzbyjfCGk #DramaQueen\' 

\'#FreeSunder @PMOIndia The world watches as India allows the torture of temple elephants to continue. PLEASE SHARE http://t.co/g8f1kgdasU\'
india

```

I want to get tinyurl from all such user tweets

my code:

```
<?php

$reg_exUrl = "/(?<![\>https?:\/\/|href=\"'])(?<http>(https?:[\/][\/]|www\.)([a-z]|[A-Z]|[0-9]|[\/.]|[~])*)/";
// The Text you want to filter for urls
$text = "Whn I ws calld for ths song lulz http://t.co/6vzbyjfCGk #DramaQueen\ ";
// Check if there is a url in the text
    if(preg_match($reg_exUrl, $text, $url))
    {
        echo preg_replace($reg_exUrl, "<a href='{$url[0]}'>{$url[0]}</a> ", $text);
    } else {       // if no urls in the text just return the text
       echo $text;
}

```

echo here prints actual tweets only

This gives only one url , how can I get all url from tweets?

Answer: 
Well, you're **lucky**.  

It seems to be **possible**: see [this](https://stackoverflow.com/questions/10696986/how-to-set-the-part-of-the-text-view-is-clickable) link.  

Another method could be to put an hyperlink in your string.
i did not try this but i think if you use below hint then may be You will success.
txt.setText(Html.fromHtml("...link..."));
txt.setMovementMethod(LinkMovementMethod.getInstance());

[select a word on a tap in TextView/EditText](https://stackoverflow.com/questions/8612652/select-a-word-on-a-tap-in-textview-edittext)

i think it will help.