作者pinkisme ()
看板RegExp
標題[問題] 請問字串擷取的方式
時間Wed Nov 21 02:21:31 2007
因為是用php開發,想請問一下
比方說有一個字串
$string = "this is an apple!"
而我想要取出字串分別是this,is,an,apple
那他的reg exp應該怎樣表示呢?
實在想不太出來該怎樣去做,麻煩各位了@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.156.75
推 aoc90058:$string = "this is an apple!"; 11/21 03:16
→ aoc90058:$pattern = "([a-zA-Z]+)"; 11/21 03:16
→ aoc90058:preg_match_all($pattern,$string,$a); 11/21 03:17
推 pinkisme:感謝各位的回答 @@" 11/21 04:07