#!/usr/bin/php .*? += (.+?)}', #preg_match_all('{(\d+.*? += +\d+.*?)}', # too much is matched... file_get_contents('http://www.google.com/search?q=' . urlencode(join(' ', array_splice($argv, 1)))), $matches); print str_replace(' ', ',', "{$matches[1][0]}\n"); ?>