Hello,

I am fairly new to perl and am having problems matching a specific
character.  I want to be able to match the "_" character at the end of a
string.  For example, asume I have an array of strings with the following
data:

 $array{0} = "clk_n"
 $array{1} = "test_in_6_"
 $array{2} = "clk_out"

I want to create a regular expression which will match $array{1} and not the
others in the array.  This is what I have so far.

 foreach (@array) {
  if(m/$\w+\_/) {
   print "Matched, $_\n";
  }
}

This isn't giving the results I want, instead it will match the "_"
character in the middle of the string as well as the end of the string.  Any
ideas or suggestions on how this can be done?  Thanks in advance,

-Phillip Prentice


Reply via email to