你好朋友我是新的模式匹配在PHP中。什麼「。」意味着在正則表達式
我想這個代碼之間找到「@」和「空間」
<?php
$pattern = "%@(.*?)\s%";
$string = "this is @test string @match ";
preg_match_all($pattern, $string, $match);
echo "<pre>";
print_r($match);
echo "</pre>";
?>
它工作正常,沒有錯誤的文字... 我的問題是什麼呢「」意味着在這個 我知道像
% is terminaor
(start of substring
) end of substring
* 0 or more match
等其他符號的意思..但不明白的使用「」在這裏.. 任何機構可以解釋它。而糾正我,如果我錯了,其他地方提前
'.'表示任何字符 – Class 2013-03-24 04:45:32
以下是PHP手冊中的頁面,可以解答您的所有問題,例如:http://www.php.net/manual/en/reference.pcre.pattern.syntax.php – 2013-03-24 04:51:18
感謝所有得到它:) – alwaysLearn 2013-03-24 05:00:12