On 1 July 2011 15:24, Jim Cheetham <[email protected]> wrote: > On Fri, Jul 1, 2011 at 2:28 PM, Kent Fredric <[email protected]> wrote: >> Found an edge case: abcd -> abcdZ >> >> https://gist.github.com/1057759 > > Fantastic! > > Now I have to think about how to prevent it from happening (or > actually, how to clean up afterwards), and whether preventing it is > even necessary, given the original problem description. > > Hey Glenn, care to share some comments about what you were really > doing with this? And what your limited platform is? >
I have a suggestion that may work. 1. Place a "Magic Token" of some form on the right of the string, ie "__TOKEN__" 2. Move up to 5 characters from the start of the string to the end. 3. Apply the rule to all characters before the token. 4. Move the characters after the token to before the string 5. Remove the token. -- Kent perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );" http://kent-fredric.fox.geek.nz _______________________________________________ Linux-users mailing list [email protected] http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
