echo foobar | pcre2grep -o1 -o2 -o3 --om-separator=, '(.)(.)(.)'

echo foobar | perl -C -lne 'print "$1,$2,$3" while /(.)(.)(.)/g'
