Remove leading zeros

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

othni
Posts: 34
Joined: Tue Mar 01, 2005 1:47 am
Location: San Juan, Puerto Rico
Contact:

Remove leading zeros

Postby othni » Sat Sep 02, 2006 9:43 am

I just want to remove leading zeros.

I tried:

^0{1,}

But it removes only the first one. This is my Trial Text:

0123
1230
00123
000456
123456


Al leading zeros have to be removed. Maybe is so easy I do not see it.

Or maybe it is Friday Night at the office after 7:30pm and my brain is home already?

User avatar
DataMystic Support
Site Admin
Posts: 2136
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Mon Sep 04, 2006 12:34 pm

Perl pattern by default are non-greedy, so either re-write the pattern as:

^0{1,}?

or change the pattern options to greedy.
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

othni
Posts: 34
Joined: Tue Mar 01, 2005 1:47 am
Location: San Juan, Puerto Rico
Contact:

Postby othni » Tue Sep 05, 2006 5:59 am

Thank you it worked great


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest