내 패턴이다 /(productimages\/)(\w*)(\/v\/)(\w*)(.jpg)/g
데이터 : http://gskinner.com/RegExr/?2ujor알 개질제 'g'PHP 정규식 오류
및 PHP 코드 :
$regexp = ' /(productimages\/)(\w*)(\/v\/)(\w*)(.jpg)/g';
if(preg_match("$regexp", $input, $matches, PREG_SET_ORDER)) {
for($i=0;$i<14;$i++){
echo '--->'.$i.'-->'.$matches[0][$i];
}}
결과 경고 :는 preg_match() function.preg- 매치] 알 개질제 'g'
$regexp = ' /(productimages\/)(\w*)(\/v\/)(\w*)(.jpg)/g';
if(preg_match_all("$regexp", $input, $matches, PREG_SET_ORDER)) {
for($i=0;$i<14;$i++){
echo '--->'.$i.'-->'.$matches[0][$i];
}}
결과 경고 :으로, preg_match_all() function.preg-완전 일치] 알 개질제 'g'는
이없는 용액 일! : | "Unknown modifier 'g' in..." when using preg_match in PHP?
어떻게해야합니까?
$regexp = ' /(productimages\/)(\w*)(\/v\/)(\w*)(.jpg)/';
작동 하겠지만,이 점에 맞게'\을 .' 사용해야합니다. –