【发布时间】:2015-06-30 15:49:18
【问题描述】:
这是我之前的 SO 问题的扩展:PHP Get string after a specific regex pattern match
目前我正在使用这种模式:
$pattern = '/(?<=The following users in your Google Apps domain appear to be affected: )\S+/i';
我希望能够使用这样的东西:
$pattern = '/(?<=The following * affected: )\S+/i';
使用以下方法获得相同的结果:
if (preg_match($pattern, $eBody, $matches)) {
echo $matches[0] . "# <br>";
}
【问题讨论】:
-
我想你在
following之后想要.*,而不仅仅是*。
标签: php regex string preg-match wildcard