Q:

PHP grabbing content between two strings

// get CONTENT from united domains footer
$content = file_get_contents('http://www.uniteddomains.com/index/footer/');

// remove spaces from CONTENT
$content = preg_replace('/\s+/', '', $content);

// match all tld tags
$regex = '#target="_parent">.(.*?)</a></li><li>#';
preg_match($regex, $source, $matches);

print_r($matches);

I am wanting to match all of the TLDs:
Each tld is preceded by target="_parent">. and followed by </a></li><li>
I am wanting to end up with an array like array('africa','amsterdam','bnc'...ect ect )
What am I doing wrong here? 
NOTE: The second step to remove all the spaces is just to simplify things. 

A:

Here's a regular expression that will do it for that page.
\.\w+(?=</a></li>)

REY
PHP
$content = file_get_contents('http://www.uniteddomains.com/index/footer/');
preg_match_all('/\.\w+(?=<\/a><\/li>)/m', $content, $matches);
print_r($matches);

PHPFiddle
Here are the results:
.africa,  .amsterdam,  .bcn,  .berlin,  .boston,  .brussels,  .budapest,  .gent,  .hamburg,  .koeln,  .london,  .madrid,  .melbourne,  .moscow,  .miami,  .nagoya,  .nyc,  .okinawa,  .osaka,  .paris,  .quebec,  .roma,  .ryukyu,  .stockholm,  .sydney,  .tokyo,  .vegas,  .wien,  .yokohama,  .africa,  .arab,  .bayern,  .bzh,  .cymru,  .kiwi,  .lat,  .scot,  .vlaanderen,  .wales,  .app,  .blog,  .chat,  .cloud,  .digital,  .email,  .mobile,  .online,  .site,  .mls,  .secure,  .web,  .wiki,  .associates,  .business,  .car,  .careers,  .contractors,  .clothing,  .design,  .equipment,  .estate,  .gallery,  .graphics,  .hotel,  .immo,  .investments,  .law,  .management,  .media,  .money,  .solutions,  .sucks,  .taxi,  .trade,  .archi,  .adult,  .bio,  .center,  .city,  .club,  .cool,  .date,  .earth,  .energy,  .family,  .free,  .green,  .live,  .lol,  .love,  .med,  .ngo,  .news,  .phone,  .pictures,  .radio,  .reviews,  .rip,  .team,  .technology,  .today,  .voting,  .buy,  .deal,  .luxe,  .sale,  .shop,  .shopping,  .store,  .eus,  .gay,  .eco,  .hiv,  .irish,  .one,  .pics,  .porn,  .sex,  .singles,  .vin,  .vip,  .bar,  .pizza,  .wine,  .bike,  .book,  .holiday,  .horse,  .film,  .music,  .party,  .email,  .pets,  .play,  .rocks,  .rugby,  .ski,  .sport,  .surf,  .tour,  .video

