There may be a problem though: use of scientific notation.
Assume:
<digit> ::= 0|1|2|3|4|5|6|7|8|9
<integer> ::= <digit> | <integer><digit>
<period> ::= .
<float> ::= <integer><period><integer>
A possible solution would then be:
$str = "20.34e7 is the best match for 24 or 19";
if (preg_match('/^([0-9]+\.[0-9]+)/', $str, $match))
echo $match[0];
else
echo "No match";
If you arent going to be bothered with scientific notation popping up, then the simple typecast is the way to go.