i'm not too fond of  below suggestion's variable naming, but hey,
tmtowtdi.... here's my 2 bits:

my $foo = 'test case total : 32456 allocated : 12000 from tech';

my ($num1,$num2) = $foo =~ /(\d+).+?(\d+)/;

Good luck,
Jos Boumans


Aaron Craig wrote:

> my $sLine = "test case total : 32456 allocated : 12000 from tech";
> $sLine =~ /(\d+)[^\d]+(\d+)/;
> my $lNumber1 = $1;
> my $lNumber2 = $2;
> print "number 1: $lNumber1 and number 2: $lNumber2";
>

<snip>

> >can any one suggest me a REGEX to catch the numbers in the following
> >input line:
> >test case total : 32456 allocated : 12000 from tech
> >
> >I want to catch the two numbers and insert them to vars
>

Reply via email to