I have a regular expression that should capture 4 elements but it is only capturing 3. Here is the code
<?php
$re = '/<input.+>(.*)</m';
$str = ' <input type="radio" name="562" value="1" onclick> turtle.show() <br>
<input type="radio" name="562" value="2"> turtle.showLocation() <br>
<input type="radio" name="562" value="3"> turtle.showDirection() <br>
<input type="radio" name="562" value="4"> turtle.showturtle() <br><input type="hidden" id="ans562" value="4">';
preg_match_all($re, $str, $matches);
// Print the entire match result
var_dump($matches);