I hate firing up the regexp engine when string primitives will do:

var extpos = filename.lastIndexOf('.');
if (extpos > 1)
  root = filename.substring(0, filename.lastIndexOf('.'))
else 
  root = filename

I suppose that's pretty verbose. Too bad we don't have a utility for it.  I guess the regexp is fine.