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