more useful options | |
PerlMonks |
Re: Replace multiple tabs with spaces at start of a stringby choroba (Cardinal) |
on May 16, 2017 at 22:52 UTC ( [id://1190411]=note: print w/replies, xml ) | Need Help?? |
Why can't you replace the tabs directly?
The number of spaces will be four times the number of tabs. Or, without /e :
Replace a tab with 4 spaces if it's at the start of the string or after a previously replaced tab. Update: The latter could be simplified to
as the "last match" is initially set to the beginning of the string.
In Section
Seekers of Perl Wisdom
|
|