preg_matchを使用して数行を抽出するさい、どうしてもマッチしてくれない。。。

 

デリミタの後ろにsをつけると改行認識してくれます。

 

preg_match('|hogehoge(.*?)hoge|s',$string,$pattern);