in reply to Re: Traping [** using reg exp
in thread Traping [** using reg exp

Or maybe there's whitespace at the end of the line? Try changing /...$/ to /...\s*$/ (or omit the $ completely).