in reply to using split on a string

You could forget all this regex stuff and use a standard Perl module instead :
use File::Basename; use Data::Dumper; my $path='C:\Documents and Settings\Administrator\Desktop\china.txt'; my @fileinfo=fileparse($path, '\..*'); print Dumper(@fileinfo);
will give you
$VAR1 = 'china';
$VAR2 = 'C:\\Documents and Settings\\Administrator\\Desktop\\';
$VAR3 = '.txt';
The fileparse() function takes a path as first argument and a pattern describing the extension as second arg

Jorg

"Do or do not, there is no try" -- Yoda