Re: basic pattern matching

2001-11-13 Thread EternalLifeThereAfter
- 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

Re: basic pattern matching

2001-11-10 Thread Brett W. McCoy
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

Re: basic pattern matching

2001-11-10 Thread Jonathan E. Paton
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

Re: basic pattern matching

2001-11-10 Thread Jonathan E. Paton
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 __

RE: basic pattern matching

2001-11-09 Thread Wagner-David
By adding a ^ - anchor at beginning and $ anchor at end: /^name$/# must be name /^name/ # must start with name /name$/ # must end with name Wags ;) -Original Message- From: HANSON [mailto:[EMAIL PROTECTED]] Sent: Friday, Nov

RE: basic pattern matching

2001-11-09 Thread Gibbs Tanton - tgibbs
One way is that you can use eq instead of =~. If there is a reason you can't use eq then you can use /^name$/. That will cause it only to match the string name. BTW, eq does an exact string match while =~ does a pattern match. To illustrate the difference, consider the following lines print "