s{\.(?:tar\.gz|[^.]+)\z}{};
The problem is that, in general, you can't know from a file name which part of it is "extension" and which part is not, unless you either have a clear-cut definition of what "extension" means (I don't know any that satisfies your requirement), or you have a list of all possible extensions.
In reply to Re^3: Splitting an url in its components
by moritz
in thread Splitting an url in its components
by baurel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |