\d is a shortcut for [0123456789] (any digit)
\D is a shorcut for [^0123456789] (any non digit)

You could remove " lines processed" like this: 

$string = "50 lines processed";
$string =~ s/\D//g;  #substitute any non-number character with nothing

if you are reading lines and want to not process lines that have
non-numeric elements try this:

while (<IN>) {
        continue if (/\D/);

        process($_);
}


On 05 Jun 2001 22:26:59 +1000, chris robinson wrote:
> how would one write a regular expression to exclude items that arent
> digits?
--
Today is Sweetmorn, the 10th day of Confusion in the YOLD 3167
Frink!


Reply via email to