Zero width loop
#!/usr/bin/perl use warnings; use strict; my $text = "this is a test"; while ($text =~ /(?=(.))/g) { print "[$1]"; }