in reply to Regex Help

You could have read How do I post an effective node title? to format your question...

You could search globally (modifier /g) with your regex and use pos() to identify the position of your match...

 perl -e ' $str = "a---bc---d"; while ( $str =~ m/-+/g ) { print pos( $str ), $/; } '

perldoc -f pos