fork(1) download
  1. text = "The (New York city) :) is big"
  2. arr = text.scan(/\(([^()]+)\)|(\S+)/).flatten - [nil]
  3. p arr
Success #stdin #stdout 0.02s 6056KB
stdin
Standard input is empty
stdout
["The", "New York city", ":)", "is", "big"]