eric-perl wrote at Tue, 10 Sep 2002 09:32:22 +0200:
> How can I capture all the words that contain 'at' in the string 'A fat cat
> sat on my hat.'?
>
> Any pointers?
>
> $sentence = 'A fat cat sat on my hat.'
> $sentence =~ m/(\wat)/;
>
> returns:
>
> $1 = 'fat'
As TMTWTDI, here's a solu
On Tue, 2002-09-10 at 03:32, [EMAIL PROTECTED] wrote:
> Hello, All:
>
> How can I capture all the words that contain 'at' in the string 'A fat cat
> sat on my hat.'?
>
> Any pointers?
>
> $sentence = 'A fat cat sat on my hat.'
> $sentence =~ m/(\wat)/;
>
> returns:
>
> $1 = 'fat'
>
> --
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 12:32 AM
To: Beginners Perl Mailing List
Subject: Regular Expressions: Grouping and backreferences...
Hello, All:
How can I capture all the words that contain 'at' in the
Hello, All:
How can I capture all the words that contain 'at' in the string 'A fat cat
sat on my hat.'?
Any pointers?
$sentence = 'A fat cat sat on my hat.'
$sentence =~ m/(\wat)/;
returns:
$1 = 'fat'
--
Eric P.
Sunnyvale, CA
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additiona