fork download
  1. s = "We bought 3.5 million shirts."
  2. res = s.scan(/\p{L}+|(?!\.\d)[[:punct:]]/)
  3. puts res
Success #stdin #stdout 0.02s 9784KB
stdin
Standard input is empty
stdout
We
bought
million
shirts
.