[請益] preg_match_all中的! !is是什麼?
※ [本文轉錄自 RegExp 看板]
作者: Geniusking (真理斯金) 看板: RegExp
標題: [問題] preg_match_all中的! !is是什麼?
時間: Tue Aug 4 10:13:43 2009
我寫了一個要抓option value中的字串的regexp
是用要php的preg_match_all抓
<option value="IamTarget">IamTarget(目標)</option>
<option value="IamTarget2">IamTarget2(目標2)</option>
我用的RegExp是(忘了是參考到版上那一篇的)
"!<option value=.*?>(.*?)(\(.*?\))?</option>!is";
問1:那個!與!is是什麼意思啊?
出來的結果是可以成功抓到我要的字串如下:
問2:有沒有其他建議的php Regexp寫法?
Array
(
[0] => Array
(
[0] => <option value='IamTarget'>IamTarget(目標)</option>
[1] => <option value='IamTarget2'>IamTarget2(目標2)</option>
)
[1] => Array
(
[0] => IamTarget
[1] => IamTarget2
)
[2] => Array
(
[0] => (目標)
[1] => (目標2)
)
)
感謝各位大大!
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.83.216.112
→
08/04 10:14,
08/04 10:14
--
☆
╭──╮╭──╮┌╭─╮ ○ ┌┐┌┐╭──╮┌┐┌┐ ○ ┌╭─╮╭──┐
│╭─┘│╭╮││╭╮│ ┌┐ │││││╭─╯│╰╭╯ ┌┐ │╭╮││╭╮│
│┌┐││┌─╯││││ ││ │╰┘│╰─╮╮│╭╮╮ ││ ││││╰─┐│
╰──╯╰──╯└┘└┘ └┘ ╰─└┘╰──╯└┘└┘ └┘ └┘└┘╰──╯
http://www.wretch.cc/blog/Geniusking ☆
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.83.216.112
推
08/04 13:42, , 1F
08/04 13:42, 1F
→
08/04 14:01, , 2F
08/04 14:01, 2F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章