\G Match only where previous m//g left off (works only with /g)Try the following:
perl -e "$num = \"0000012345\"; $num =~ s/\G0/ /g;print $num"
Cheers,
Ovid
Update: Just saw merlyn's response and wanted to note that I have Effective Perl Programming. Where the heck do you think I got that regex? :)
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to (Ovid) Re: Regex to zero suppress
by Ovid
in thread Regex to zero suppress
by Theodorus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |