-Original Message-
From: Robin [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 11, 2005 09:27
To: beginners@perl.org
Subject: Re: Regular expression not working as expected
>>>>> This is correct, it's because you're saying "find two 'o' next
On Friday 12 August 2005 02:11, Daniel Kurtz wrote:
> "fo" =~ /o{2}/ = false
> "foo" =~ /o{2}/ = true
> "fooo" =~ /o{2}/ = true
This is correct, it's because you're saying "find two 'o' next to each
other somewhere", with no other restrictions. In this example,
According to the tutorial I'm following:
{n}matches exactly n of the previous thing
Thus I expect:
"fo" =~ /o{2}/ = false
"foo" =~ /o{2}/ = true
"fooo" =~ /o{2}/ = false
Instead I get:
"fo" =~ /o{2}/ = false
"foo" =~ /o{2}/ =
According to the tutorial I'm following:
{n}matches exactly n of the previous thing
Thus I expect:
"fo" =~ /o{2}/ = false
"foo" =~ /o{2}/ = true
"fooo" =~ /o{2}/ = false
Instead I get:
"fo" =~ /o{2}/ = false
"foo" =~ /o{2