$re = '/google.*cpc/m';
$str = 'google.fr
google.co.jp
google.co.kr
google.com.my
google.ae
accounts.google.com.sg
accounts.google.co.id
google/cpc/[google][cpc][house][sale]
google/cpc/[google][cpc][condo][sale]
google/cpc/[google][cpc][house][sale][กรุงเทพ]
google/cpc/[google][cpc][condo][rent]
google/cpc/[google][cpc][land][sale]
google/cpc/[google][cpc][townhouse][sale]
google/cpc/[google][cpc][house][rent]
google/cpc/[google][cpc][apartment][rent]
google/cpc/[google][cpc][land][sale][กรุงเทพ]
google/cpc/[google][cpc][condo][sale][กรุงเทพ]
google/cpc/[google][cpc][commercial][sale]
google/cpc/[google][cpc][house][sale][ปทุมธานี]
google/cpc/[google][cpc][commercial][rent]
google/cpc/[google][cpc][land][sale][ปทุมธานี]
google/cpc/[google][cpc][house][sale][ชลบุรี]
google/cpc/[google][cpc][condo][sale][bangkok]
google/cpc/[google][cpc][townhouse][rent]
google/cpc/[google][cpc][house][sale][เชียงใหม่]
google/cpc/[google][cpc][townhouse][rent][กรุงเทพ]
google/cpc/[google][cpc][land][sale][ชลบุรี]';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php