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?
Remove leading zeros
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2229
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Perl pattern by default are non-greedy, so either re-write the pattern as:
^0{1,}?
or change the pattern options to greedy.
^0{1,}?
or change the pattern options to greedy.
Regards,
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads