in reply to Re^2: Txet Maglning Glof, Ayobndy? (eagle)
in thread Txet Maglning Glof, Ayobndy?

So all but first and last must be reordered, but nobody said they must be randomly scrambled. 35
perl -pe 's/(?<=\w)(\w+)(?=\w)/(reverse$1)/eg' file 12345678901234567890123456789012345

Replies are listed 'Best First'.
Re: Re: Re^2: Txet Maglning Glof, Ayobndy? (eagle)
by jmcnamara (Monsignor) on Sep 16, 2003 at 08:08 UTC

    Ditch efficiency and save four strokes: :-)
    perl -pe 's/(?<=\w)\w+(?=\w)/reverse$&/eg' file

    --
    John.

Re: Re: Re^2: Txet Maglning Glof, Ayobndy? (eagle)
by Anonymous Monk on Sep 16, 2003 at 08:15 UTC
    Doh! And I guess we don't need no stinking look(ahead|behind)s either (22):
    perl -pe 's/\B\w+\B/reverse$&/eg' file