$re = '/\W+注册单位:\W+注册编号/执业印章号:(\W|\d)+注册专业:\W+有效期:\d+年\d+月\d+日/ms';
$str = '一级注册建造师
注册单位:
云南移民产业投融资有限公司
注册编号/执业印章号:
云1532018201900531
注册专业:
建筑工程
有效期:
2026年08月23日';
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