On Dec 16, Paul Kraus said:
>How can I grab a numeric string that contains commas.
... that ALSO contains periods in it.
>POINT Point Health Centers 19,466.79
>0.00 401.20 0.00 19,867.99
>if (/(^POINT)\s+ Point Health Centers\s+([\d\,]*)\s+.*/){
> print "$1 $2\n";
> }
The [\d\,]* matches "19,466", but then \s+ can't match because the next
character is a ".", so eventually, [\d\,]* matches NO characters at all
(since * means zero or more). Try:
if (/^POINT\s+Point Health Centers\s+([\d.,]+)/) {
$val = $1;
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
<stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.
[ I'm looking for programming work. If you like my work, let me know. ]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]