From: darren kirby Date: 2006-06-07T11:09:42+09:00 Subject: Re: regex for splitting filenames --nextPart1493823.ASYHZyLBcz Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline quoth the Austin Ziegler: > On 6/6/06, darren kirby wrote: > > fileroot, type =3D filename.split(/regex here?/) > > > > I cannot find a way to write a regex that only matches the last period = in > > the filename. Is there an elegant way to do this? > > ext =3D File.extname(filename) > file =3D File.basename(filename, ext) > > -austin Thanks. I should have guessed there would be a builtin for it... =2Dd =2D-=20 darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." =2D Dennis Ritchie and Ken Thompson, June 1972 --nextPart1493823.ASYHZyLBcz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBEhjVjwPD5Cr/3CJgRAtHdAKDDWTassPMjw0yS4keaBIXOeVPOLACdEx6b S8mjINXm4yISvLf6A8Ysbes= =me0r -----END PGP SIGNATURE----- --nextPart1493823.ASYHZyLBcz--