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 Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to