Re: [請益] PCRE 看不懂..

看板PHP作者 (阿空)時間18年前 (2007/03/20 14:21), 編輯推噓2(201)
留言3則, 3人參與, 最新討論串2/2 (看更多)
※ 引述《ialk (175)》之銘言: : 接著那串/\s*({$quote}?)(.*?)\\1\s*(?:{$delim}|$)/ : ^^^^^^^^ : 請問這段是什麼意思 ? (.*?)的部份.... . 是"不含換行的任何字元" * 是"零次以上" ? 是"零或一個" 其他請google正規表示法 \\1的部分我在http://php.nctu.edu.tw/manual/en/function.ereg-replace.php 查到 If pattern contains parenthesized substrings, replacement may contain substrings of the form \\digit, which will be replaced by the text matching the digit'th parenthesized substring; \\0 will produce the entire contents of string. Up to nine substrings may be used. Parentheses may be nested, in which case they are counted by the opening parenthesis. : 最後的matches[2]又是什麼 @@ 同樣根據官網http://php.nctu.edu.tw/manual/en/function.preg-match-all.php $matches[0] is the first set of matches, and $matches[0][0] has text matched by full pattern, $matches[0][1] has text matched by first subpattern and so on. Similarly, $matches[1] is the second set of matches, etc. -- 只要抓住他那根尾巴 就可以讓他服服貼貼的 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.104.57.62

03/20 14:22, , 1F
可是為什麼在'*'的後面又放了'?'呀?
03/20 14:22, 1F

03/20 15:53, , 2F
在這個版掃"正規" 這兩個字, 你就可以看到夠多中文資料了
03/20 15:53, 2F

03/20 16:35, , 3F
感謝:p
03/20 16:35, 3F
文章代碼(AID): #15_trtah (PHP)
討論串 (同標題文章)
本文引述了以下文章的的內容:
2
2
完整討論串 (本文為第 2 之 2 篇):
2
2
文章代碼(AID): #15_trtah (PHP)