ok I knew that :) for some reason I was thinking \s meant any white
space that follows but it just means any 1 white space character without
quantifiers.
Ok so then why does this work
if (/Report Total:\s+[\d,.]+/){
print "\$&=$&\n";
}
and this not work.
if (/Report Total:\s+
[\d,.]+/x){
print "\$&=$&\n";
}
??
> -----Original Message-----
> From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 19, 2002 11:46 AM
> To: Perl
> Subject: Re: This should work but returns nothings - REGXPR
>
>
> From: "Paul Kraus" <[EMAIL PROTECTED]>
> > Whats wrong with this regexpr?
> >
> > $string = " Report Total: 2300,150.17
> > 1352,768.15 554,392.38 277,186.72 84,321.84
> 31,481.08";
> >
> >
> > if ($string=~ m/Report Total:\s
> > ([\d,.]+)\s
> > ([\d,.]+)\s
> > ([\d,.]+)\s
> > ([\d,.]+)\s
> > ([\d,.]+)\s
> > ([\d,.]+)/x){
> > print "$&\n" ;
> > }
>
> \s is just one whitespace character. You have several between the
> numbers. Use \s+
>
> Jenda
> ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
> When it comes to wine, women and song, wizards are allowed
> to get drunk and croon as much as they like.
> -- Terry Pratchett in Sourcery
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]