in reply to Golf this reg ex

Not really shorter, but easier to read...

#! /usr/bin/perl -w use strict; my $number = "..2314-1234123."; my $stuff = qr/[0-9.-]/; if ($number =~ /^($stuff*\d+$stuff*)$/) { print "$1\n"; }