$str =~ /(##(?:[^#]+|#[^#])*/g