module Aio::Base::Toolkit::Array class << self # 按pattern分割数组 def split(array, pattern) res = [[]] count = 0 array.each do |a| a = Aio::Base::Toolkit::String.safe(a) unless pattern.match(a) res[count] << a else res << [] count += 1 end end res end end end