[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-users
Subject:    Regex Question
From:       "Dirk Bremer" <dirk.bremer () nisc ! cc>
Date:       2000-12-28 20:56:55
[Download RAW message or body]

I would like a regex to replace leading zeroes in a number. For example, a
ten-digit number string has 5 leading (leftmost) zeroes. I would like to
replace each leading zero with a space, i.e. 5 leading zeroes with 5 leading
spaces. I tried s/^0+/ /g but it replaced all leading zeroes with only one
space character. How may I accomplish this?

Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471

<mailto:dirk.bremer@nisc.cc>


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic