I think regular expressions might be able to accomplish this, if not then string manipulation is also a viable solution.
I need to turn the following inputs:
"http://open.thumbshots.org/image.pxf?url=www.party.com""http://www.xclicks.net/sc/ct.php?s=9971&l=http%3A//www.google.com/imgres%3F""http://whos.amung.us/pingjs/?k=yvybju40twbs&t=Mudswimmer%3A%20Spam%20%26%20Crap%3A%20Http%3AUniversity.com%3A%20No%20Animals%20Allowed..&c=c&y=htt"
into the following outputs:
"party.com""google.com""University.com"
I am not trying to get the host name of the URL, I want the the second domain, the one in the query string.
With everything that involves regular expressions there is a degree of uncertainty, for me at least, but giving your three inputs the following code works:
The regular expression used was adapted from here.
If you run this you get the following output: