in reply to Integrating match counts into regex matching
KISS?
while ( <DATA> ){ print if /(a+)(b+)/ and length( $1 ) == length( $2 ) - 1; } __DATA__ a b x ab abb abbb aabb aabbb aabbbb ... [download]