re = %r/(?<unf>a.)/ Regex.scan(re, "abcdabcde", [capture: :groups]) this doesn't work as intended [["ab"], ["ab"]] the return should have named groups.