Use scan instead of split.