On Tue, Jan 28, 2003 at 11:22:48PM +0000, Phil Pereira wrote:
> Is there an easy way to split "123456" into "12-34-56"?

$ perl -lne 'print "$1-$2-$3" if /(\d\d)(\d\d)(\d\d)/'
123456
12-34-56
$

This should start a good TIMTOWTDI thread :)

Paul

-- 
Paul Makepeace ....................................... http://paulm.com/

"What is six pence halfpenny? Two cabbages and a giraffe."
   -- http://paulm.com/toys/surrealism/

Reply via email to