http://qs321.pair.com?node_id=532602


in reply to R.Exp. Matching from the Right

i assume you want the file name, without the path - is it right?! if so, try this:
(my $file = "c:/progra~1/apache~1/apache2/cgi-bin/test/new/Feb23-2006_ +0_test_error.txt")=~ s/.*\///g; print $file;

if you want to print the path as well, just use print $&;

update
the code above will replace the path with nothing, so the result will be just the filename. you might recover the path later, as i said, using $&.
still, if you really only want to match, i guess Praveen's reply will be more suitable.
=)


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@