- Original Message -
From: "Gibbs Tanton - tgibbs" <[EMAIL PROTECTED]>
To: "'HANSON '" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, November 10, 2001 8:06 AM
Subject: RE: basic pattern matching
> You can look at perld
On Fri, 9 Nov 2001, HANSON wrote:
> I am traversing a multidimensional hash searching for a value and
> trying to delete it. However, I am ending up deleting the wrong one.
> The value I'm looking for is /name/. There is also a value of /name1/
> in the hash. When I use =~/name/ it deletes the na
Hi,
> where ^ matches start of string
> and where matches end of string
Should be "and where $ matches end of string.
Jonathan Paton
__
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music
Charts
ht
Hi,
The problem reduced to a level I can solve:
Match "name"
but not "name1" etc
Solution:
Use ^ and $ assertions
where ^ matches start of string
and where matches end of string
hence use /^name$/
Hope that is clear enough :)
Jonathan Paton
__
Placed At : BOM
Durga Prasad@SATYAM
11/10/2001 04:09 PM
Code please...
Durga Prasad
I am traversing a multidimensional hash searching for a value and
trying to delete it. However, I am ending up deleting the wrong one.
The value I'm looking for i
, November 09, 2001 15:46
To: [EMAIL PROTECTED]
Subject: basic pattern matching
Hi gurus!
I am traversing a multidimensional hash searching for a value and
trying to delete it. However, I am ending up deleting the wrong one.
The value I'm looking for is /name/. There is also a value of /name1
quot;;
print "2" if "chris" =~ /chris/;
print "3" if "chris" =~ /^chris$/;
This will print out 123.
You can look at perldoc perlre for regular expression help and
perldoc perlop for help on eq and its relatives.
Hope this helps!
Tanton
-Original Messa
Hi gurus!
I am traversing a multidimensional hash searching for a value and
trying to delete it. However, I am ending up deleting the wrong one.
The value I'm looking for is /name/. There is also a value of /name1/
in the hash. When I use =~/name/ it deletes the name1 value somehow.
Is there