我想要字符串
中的大写单词 WORDA - WORDB - WORDC - Failure occurring to be verified if a WORDD WORDE is linked to the failure.
我想要的上述字符串的预期输出是这样的:
WORDD WORDE
答案 0 :(得分:1)
尝试:
<?php
$a= "WORDA - WORDB - WORDC - Failure occurring to be verified if a WORDD WORDE is linked to the failure.";
$b= '/([A-Z|\s\0-9]+)[a-z|\W\|0-9]*$/';
preg_match($b, $a, $c, PREG_OFFSET_CAPTURE);
print_r($c[1][0]);
?>