my @headers; while ($post->{post_message} =~ m|(?:\n)?\=\=([a-z0-9_ &\[\]ÀÂÄàâäÇçÉÊÈËéêèëÏÌÎïìîÖÔÒöôòÜÛÙüûùA-Z?!;«»()"\s]+)\=\=|g) { my $section = get_section_code($1,$post->{post_message}); my @subheaders; while ($section =~ m|\n\=\=\=([a-z0-9_ &\[\]ÀÂÄàâäÇçÉÊÈËéêèëÏÌÎïìîÖÔÒöôòÜÛÙüûùA-Z?!;«»()"\s\-]+)\=\=\=|g) { push @subheaders, $1; } push @headers, { Section => $1, SubLoop => \@subheaders }, }