On 3/22/06, S.A. Birl <[EMAIL PROTECTED]> wrote:

> Im looking to subtitute all but the last . into _
>         ie: filename.jpg.pgp   --> filename_jpg.pgp
>         ie: filename.2.jpg.pgp --> filename_2_jpg.pgp
>         ie: file....._.jpg.pgp --> file__________.pgp

There are many ways to do this; here's the first one I thought of,
using a lookahead assertion to see that there's another dot remaining:

    s/\.(?=.*\.)/_/gs

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to