I think use sed is more convenient:
grep "sync;sync;reboot" cron* |head -1 | sed 's/[0-9*\\]//g;s/^[ ]*//'
If you want to use ruby to shave the expression you can find what you 
wanted in ruby regexp,it's a piece of cake in ruby world.

-- 
Posted via http://www.ruby-forum.com/.