Um... You need to escape that full stop.
>perl -e "print 'match' if '1234X789' =~ /^(-?)(\d+.)?\d+$/" match
In reply to Re^2: Reg Ex exercise by thundergnat in thread Reg Ex exercise by keesturam