时间:2021-07-01 10:21:17 帮助过:31人阅读
SW Design and ISS Scrum Team 2
LR RF & HW Modules->LR WCDMA CPRI Baseline->LR CPRI Misc.->SW Dev and Test
$str=<< LR RF & HW Modules->LR WCDMA CPRI Baseline->LR CPRI Misc.->SW Dev and Test html; //echo $str;quit(); preg_match_all('/(?:\s+|->)]*>(.*)<\/a>/isU',$str,$arr); print_r($arr[1]);
------解决方案--------------------
$text=array();
$html="SW Design and ISS Scrum Team 2
LR RF & HW Modules
LR WCDMA CPRI Baseline
LR CPRI Misc.
SW Dev and Test";
preg_match_all('|Program\/Domain\/BU\'>(.+)<\/a>|',$html, $matches);
$text[0]=$matches[1][0];
preg_match_all('|Technical Domain\'>(.+)<\/a>|',$html, $matches);
$text[1]=$matches[1][0];
preg_match_all('|Project\'>(.+)<\/a>|',$html, $matches);
$text[2]=$matches[1][0];
preg_match_all('|title=\'Team\' >(.+)<\/a>|',$html, $matches);
$text[3]=$matches[1][1];
print_r($text);
------解决方案--------------------
(?:Expression) 非捕获组 进行子表达式Expression的匹配,并将匹配内容保存到最终的整个表达式的区配结果中,但Expression匹配的内容不单独保存到一个组内
| 或的意思