use \w not [[:word:]], the latter is not in ruby 1.8