您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
三六零分类信息网 > 绍兴分类信息网,免费分类信息发布

求正则表达式解决方法

2025/6/24 19:57:24发布24次查看
求正则表达式
字符串:
php code sw design and iss scrum team 2
lr rf & hw modules->lr wcdma cpri baseline->lr cpri misc.->sw dev and test
求将 lr rf & hw modules,lr wcdma cpri baseline, lr cpri misc. ,sw dev and test 这四个取出来的正则,以及只取出lr rf & hw modules的正则表达式。
我在php里用的函数是preg_match.
谢谢了!!
------解决方案--------------------
php code$str=sw design and iss scrum team 2
lr rf & hw modules->lr wcdma cpri baseline->lr cpri misc.->sw dev and test html;//echo $str;quit();preg_match_all('/(?:\s+|->)]*>(.*)/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\'>(.+)|',$html, $matches);
$text[0]=$matches[1][0];
preg_match_all('|technical domain\'>(.+)|',$html, $matches);
$text[1]=$matches[1][0];
preg_match_all('|project\'>(.+)|',$html, $matches);
$text[2]=$matches[1][0];
preg_match_all('|title=\'team\' >(.+)|',$html, $matches);
$text[3]=$matches[1][1];
print_r($text);
------解决方案--------------------
(?:expression) 非捕获组 进行子表达式expression的匹配,并将匹配内容保存到最终的整个表达式的区配结果中,但expression匹配的内容不单独保存到一个组内
| 或的意思

绍兴分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product