Re: Making regex's

2009-02-11 Thread Dermot
2009/2/10 Gunnar Hjalmarsson : > Dermot wrote: >> >> I am trying to create a regex to match a directory name in path string >> >> my $dir = dirname(shift); >> (my $code) = ($dir =~ m|track.(\w{3}).|); >> return $code; > > An unescaped . in a regex matches any character except a newline. I suppos

Re: Making regex's

2009-02-10 Thread Gunnar Hjalmarsson
Dermot wrote: I am trying to create a regex to match a directory name in path string my $dir = dirname(shift); (my $code) = ($dir =~ m|track.(\w{3}).|); return $code; An unescaped . in a regex matches any character except a newline. I suppose you meant m|track\.(\w{3})\.| -- Gunnar Hj

Re: Making regex's

2009-02-10 Thread Dermot
2009/2/10 John W. Krahn : > Dermot wrote: >> >> Hi, > > Hello, > >> I just hit something that I hadn't noticed before and I am not sure >> it's it's a syntax issue or I have not been doing my reading. >> >> I am trying to create a regex to match a directory name in path string >> Is that right? >

Re: Making regex's

2009-02-10 Thread John W. Krahn
Dermot wrote: Hi, Hello, I just hit something that I hadn't noticed before and I am not sure it's it's a syntax issue or I have not been doing my reading. I am trying to create a regex to match a directory name in path string my $dir = dirname(shift); (my $code) = ($dir =~ m|track.(\w{3

Making regex's

2009-02-10 Thread Dermot
Hi, I just hit something that I hadn't noticed before and I am not sure it's it's a syntax issue or I have not been doing my reading. I am trying to create a regex to match a directory name in path string my $dir = dirname(shift); (my $code) = ($dir =~ m|track.(\w{3}).|); return $code; I