Gunnar Hjalmarsson schreef:
> 1. Why is rewriting so bad? Personally I need to look up those
> extended patterns, and letting the s/// operator rewrite a single dot
> is easier to read IMO.
That is exactly why I suggested that the 5.10.x regex-optimiser should
take care of that. But only if it pa
Dr.Ruud wrote:
Gunnar Hjalmarsson schreef:
danlamb:
I need a regex to remove zeros after the . in a file name if they are
followed by another digit.
Example: XX.001 becomes XX.1
s/\.0+(?=[1-9])/./;
That rewrites the dot, and won't handle ".000".
I would write it like
s
Gunnar Hjalmarsson schreef:
> danlamb:
>> I need a regex to remove zeros after the . in a file name if they are
>> followed by another digit.
>>
>> Example: XX.001 becomes XX.1
>
> s/\.0+(?=[1-9])/./;
That rewrites the dot, and won't handle ".000".
I would write it like
s/(?
On Nov 12, 7:51 pm, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote:
> s/\.0+(?=[1-9])/./;
Thank you Gunnar. This did exactly what I needed.
Dan Lamb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
s/\.0+(\d+)/\.\1/;
The above substitution works.
Ashok
On 11/13/07, danlamb <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> I need a regex to remove zeros after the . in a file name if they are
> followed by another digit.
>
> Example: XX.001 becomes XX.1
>
> Any ideas? I've been banging
danlamb wrote:
I need a regex to remove zeros after the . in a file name if they are
followed by another digit.
Example: XX.001 becomes XX.1
s/\.0+(?=[1-9])/./;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For