私は、テキストとパターンの配列を持っています。私はパターンの配列内のすべてのパターンのテキストの配列内の各要素を検索しようとしています。しかし、私は以下のエラーが発生していると私はどこに間違っているのか分からない。preg_match - パターンの配列を使用する - PHP
$participantVcRoomName = '/PR GMVC RP K GRAY/i';
$sipURI = '/+13135539892/i';
$row = '¤¤AdhocCallAdded¤¤[email protected]';
$row2 = '¤¤SentMessageToSystem¤¤The conference was extended, the new end time
is: 10:45 AM¤¤PR GMVC RP K GRAY';
$row3 = '¤¤ConferenceEndTimeChanged¤¤09/13/2017 15:30:00 -05:00¤¤09/13/2017
10:30:00 -05:00';
$arrayDescp = [$row, $row2, $row3];
$arrayPatterns = [$participantVcRoomName, $sipURI];
foreach($arrayDescp as $target){
foreach($arrayPatterns as $aPattern){
$match = preg_match($aPattern, $target);
if($match){
echo 'match<br>';
}else{
echo 'no match<br>';
}
}
}
エラーメッセージ:
preg_match(): Compilation failed: nothing to repeat at offset 0