Just for the TIMTOWTDI, here's one using substr and rindex:
my $n = 'foo.bar.txt'; $n = substr $n, 0, rindex( $n, q{.} );
In my own code, I'd write s{ \. [^.]+ \z }{}xms
In reply to Re: Regex To Remove File Extension (rindex)
by kyle
in thread Regex To Remove File Extension
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |