Does not the OS treat anything past the last "." as a file extension?

you can use split...

Code:

$files = "file.1.txt","file.txt","file","file.html","file.txt.html"
for each $file in $files

$file = split($file,".")
if ubound($file) > 0
? join($file,".",ubound($file))
else
? join($file,".")
endif

next