Re: elegant REGEX

2001-05-18 Thread Jos Boumans
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 alloc

Re: elegant REGEX

2001-05-18 Thread Timothy Kimball
: 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 Elegant? Regex? ;) $line = 'test case total : 32456 allocated : 12000 from tech'

Re: elegant REGEX

2001-05-18 Thread Aaron Craig
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"; At 02:34 18.05.2001 +0300, you wrote: >Hi guys, >can any one suggest me a REGEX to catch the numbers in the f

elegant REGEX

2001-05-18 Thread Roiy
Hi guys, 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 thx.