perl -le '$_="00110011111110111111111111111110"; $m=( sort({length($b) +<=>length($a)} /(1+)/g ) )[0];s/$m/2 x length $m/e;print'
Paul
In reply to Re: how to replace a matched pattern in a string with a different pattern of same length?
by rev_1318
in thread how to replace a matched pattern in a string with a different pattern of same length?
by BhariD
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |