Rubyで次の正規表現を試しました:
"the foodogand the catlada are mouseing".scan(/\b(?=\w{6,12}\b)\w{0,9}(cat|dog|mouse)\w*/)
しかし、それが戻る代わりに
["foodogand", "catlada", "mouseing"]
私は得ています
[["dog"],["cat]] # the results are also in arrays
ここで何が問題なのですか?結果も配列になっています。これを平坦化できますが、回避する方法はありますか?