#!/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
In reply to Re: Golf this reg ex
by Enlil
in thread Golf this reg ex
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |