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"; }
In reply to Re: Golf this reg ex
by pbeckingham
in thread Golf this reg ex
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |