$test =~ / ( # capture \{{1} # SINGLE open curlybrace [a-z]{4,5} # followed by 4 or 5 lowercase letters \s\d\s\d\s # fol by whitespace, digit, whitespace, digit, space [^}]+? # fol by anything_not_a_closingcurly, one-or-more_times-but-as_few_as_poss \}\s\{ # closingcurly fol by whitespace fol by opencurly (tween element 4 and element 5) [^}]+? # fol by anything_not_a_closingcurly, one-or-more_times-but-as_few_as_poss \}{2} # closingcurly twice )/gx; # end capture, global, xtended syntax, end if_test