$re = '/[^\b\s/\'"`=:]*?(?:\.|\b)(?:jinritemai|douyinec|bytedance)\.com\b/i';
$str = 'jinritemai.com
fdasf.jinritemai.com
fxg.jinritemai.com
中文.jinritemai.com
a.b.c.c.c.d.f.jinritemai.com.cn
ajinritemai.com
douyinec.com
fdasf.douyinec.com
fxg.douyinec.com
中文.douyinec.com
a.b.c.c.c.d.f.douyinec.com.cn
edouyinec.com
douyinec.com
fdasf.bytedance.com
fxg.bytedance.com
中文.bytedance.com
a.b.c.c.c.d.f.bytedance.com.cn
abytedance.com
';
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