$str =~ s/((^|\n| |\t)(?: |\t|(?<! |\t)\n)*)/$2/gs;
fixes most cases but doesn't convert a tab to a space if it is the first character in a white space string of characters.
In reply to Re: removing redundantwhitespace
by GrandFather
in thread removing redundantwhitespace
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |