Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php preg_match_all:警告:preg_match_all():未知修饰符';(';in_Php_Regex_Preg Match_Preg Match All - Fatal编程技术网

Php preg_match_all:警告:preg_match_all():未知修饰符';(';in

Php preg_match_all:警告:preg_match_all():未知修饰符';(';in,php,regex,preg-match,preg-match-all,Php,Regex,Preg Match,Preg Match All,可能重复: 我正在尝试匹配这种模式 $regex_pattern = '<td id="(\w+)" class="(\w+)">(\w+).com<\/td>'; preg_match_all($regex_pattern, $result, $matches); print_r($matches); $regex_pattern='(\w+.com'; preg_match_all($regex_pattern,$result,$matches); 打印(匹

可能重复:

我正在尝试匹配这种模式

 $regex_pattern = '<td id="(\w+)" class="(\w+)">(\w+).com<\/td>';
 preg_match_all($regex_pattern, $result, $matches);
 print_r($matches);
$regex_pattern='(\w+.com';
preg_match_all($regex_pattern,$result,$matches);
打印(匹配项);
但我得到了这个错误:警告:preg_match_all():中的未知修饰符“(”

我的正则表达式模式出了什么问题?

在使用PCRE函数时,要求图案用分隔符括起来。分隔符可以是任何非字母数字、非反斜杠、非空白字符

常用的分隔符有正斜杠(/)、散列符号(#)和波浪号(~)

$regex_pattern='/(\w+).com/;
preg_match_all($regex_pattern,$result,$matches);
打印(匹配项);

在使用PCRE函数时,要求图案用分隔符括起来。分隔符可以是任何非字母数字、非反斜杠、非空白字符

常用的分隔符有正斜杠(/)、散列符号(#)和波浪号(~)

$regex_pattern='/(\w+).com/;
preg_match_all($regex_pattern,$result,$matches);
打印(匹配项);
 $regex_pattern = '/<td id="(\w+)" class="(\w+)">(\w+).com<\/td>/';
 preg_match_all($regex_pattern, $result, $matches);
 print_r($matches);