Like I said in the CB,
my $base = 'C:\\fldr1\\fld2\\'; $str =~ s/\@\@.*//s; $str =~ s/^\Q$base\E//;
or better yet
use File::Spec::Functions qw( abs2rel ); my $base = 'C:\\fldr1\\fld2'; $str =~ s/\@\@.*//s; $str = abs2rel($str, $base);
In reply to Re: Extract middle string from a path using RegExp
by ikegami
in thread Extract middle string from a path using RegExp
by dani_cv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |