Reqexの質問:単語を抽出する
lucky
charms
文字列から:
<a>lucky <b>charms</b></a>
私の試み:
preg_match_all("/<(.*)>(.*)<\/(.*)>+/is", $text, $matches);
print_r($matches);
結果:
Array
(
[0] => Array
(
[0] => <a>lucky <b>charms</b></a>
)
[1] => Array
(
[0] => a>lucky <b>charms</b
)
[2] => Array
(
[0] =>
)
[3] => Array
(
[0] => a
)
)