Code:
on $*:text:/^(\44?\d{3}\54?\d{3,})/S:#:.msg # The number $regml(1) was said.
Use regex without a while loop for this. This also strips out control codes.

Please note this is based upon the example you've shown. There might be a possibility it'll fail if you have numbers like this:
Quote:
$1,264.10
for example. The regex may need to be modified.