in reply to how to replace a matched pattern in a string with a different pattern of same length?
$s = '00111100110';; $s =~ s[(1+)]['2' x length $1]e;; print $s;; 00222200110
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to replace a matched pattern in a string with a different pattern of same length?
by BhariD (Sexton) on Jun 19, 2011 at 14:32 UTC | |
by roboticus (Chancellor) on Jun 19, 2011 at 14:42 UTC | |
by BrowserUk (Patriarch) on Jun 19, 2011 at 15:56 UTC |