http://www.perlmonks.org?node_id=989458


in reply to Retain first 4 characters of a string

1. You can split by space and process every word.
2. You can capture the first 4 characters between word boundaries (\b) globally.

I'm too lazy to be proud of being impatient.