On Mon, Aug 05, 2002 at 12:57:30PM +0900, Gavin Sinclair wrote:
> > On Mon, Aug 05, 2002 at 11:37:12AM +0900, David Alan Black wrote:
> >>
> >> Try this:
> >>
> >>   /\.[^.]*$/
> >>
> >> which forces the match to start at the right-most '.' on the line.
> >>
> >  or this:
> >
> >   /\w+$/
> 
> Hmm.. that'll do! :)  Thanks.

Note that /\w+$/ will not match all extensions. E.g.,

   fred.my-dashed-ext

will return ext.
David replied with my first (unpoosted) attempt.
To be sure you get everything past that last '.', use:

  /\.([^.]*)$/.match(file)[1]

Jim


-- 
Jim Freeze
If only I had something clever to say for my comment...
~