in reply to Regular Expression Assistance

Well, a quick solution to this could be

$_ =~ /(\/home\/monks\/thanksforhelping\d+\.ext)/

However there are some points that I would like to make:

Replies are listed 'Best First'.
Re: Re: Regular Expression Assistance
by Anonymous Monk on Jun 10, 2002 at 12:55 UTC
    This is what I thought it should look like. Unfortunately, when I tested it, I also got stuff that was on the same line as the path I wanted, but was not part of the path itself. For instance, I got:

    but you might try looking at /home/monks/thanksforhelping1234567890.ext for help

    Any suggestions on how to get rid of the excess stuff?

      I don't really know what is happening at your end, but this seems

      $_ = "but you might try looking at /home/monks/thanksforhelping1234567 +890.ext for help"; $_ =~ /(\/home\/monks\/thanksforhelping\d+\.ext)/; print $1;

      to output:

      /home/monks/thanksforhelping1234567890.ext

      So check for typos... that could be your problem