in reply to searching characters

Yes:
my $regex = join "[^$_]*", ($_) x $limit;

That way the regex won't backtrack.