On 3/22/06, tom arnall <[EMAIL PROTECTED]> wrote:
> could you explain in detail what the stuff in parens is about, i.e.,
> '?=.*\.' ?
When the first thing inside the parentheses is a question mark, it's a
sign that the parentheses are doing something special.
s/\.(?=.*\.)/_/gs
The perlre m
Tom, John,
could you explain in detail what the stuff in parens is about, i.e.,
'?=.*\.' ?
thanks,
tom arnall
north spit, ca
On Wednesday 22 March 2006 12:41 pm, Tom Phoenix wrote:
> On 3/22/06, S.A. Birl <[EMAIL PROTECTED]> wrote:
> > Im looking to subtitute all but the last . into _
> >
On Mar 22, John W. Krahn ([EMAIL PROTECTED]) typed:
> $ perl -e'
> my @files = qw[ filename.jpg.pgp filename.2.jpg.pgp file._.jpg.pgp ];
> for my $file ( @files ) {
> print "$file --> ";
> $file =~ s/\.(?=.*\.)/_/g;
> print "$file\n";
> }
> '
> filename.jpg.pgp --> filename_jpg
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
S.A. Birl wrote:
> Im doing some file renaming.
>
> 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
>
>
> Ive tried about 10 different