Hi guys-
Here's what I have thus far:
Everything works. The only problem is *special* characters. If I add in support for all the characters, it grabs the whole string (minus C:\).........I can't seem to figure this out. Any help would be greatly appreciated. BTW, I can't use the Find::File, or File::Basename modules--this needs to be done via a regex. Thanks again
~Eric
Here's what I have thus far:
Code:
#!/usr/bin/perl
use strict;
my $var = 'C:\Documents and Settings\blah\File-Upload1.doc';
$var = ($var =~ /\\([\w\- ]+\.[\w]+)$/) ? $1 : $var;
print "$var\n";
Everything works. The only problem is *special* characters. If I add in support for all the characters, it grabs the whole string (minus C:\).........I can't seem to figure this out. Any help would be greatly appreciated. BTW, I can't use the Find::File, or File::Basename modules--this needs to be done via a regex. Thanks again
~Eric