in reply to Golf this reg ex

The value *must* contain at least one number, but *may* also contain periods and hyphens.
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { print /^(?=.*\d)[\d.-]+$/ ? "THIS LINE WORKS: $_" : "THIS LINE DOESN'T: $_"; } __DATA__ .........---------........ ...............1.......... ...----1................. -----------1------------- ......................... ------------------------- ...................-1d... --------------------2---. .-.-.-.-.3983943959359395 342094242.---------------

-enlil