Reqex Question: Extract words
lucky
charms
from string:
<a>lucky <b>charms</b></a>
My attempt:
preg_match_all("/<(.*)>(.*)<\/(.*)>+/is", $text, $matches);
print_r($matches);
Result:
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
)
)