in reply to Perl pattern finding

my @matches = "-$str-" =~ /(?:-[^0-]+)*(?:-0){4,}(?=-)/g;

Useful test cases:

Note: My code doesn't find overlapping matches. It's not an issue with the pattern you describe, but it might be for other patterns.