my $re = qr{ element \s ( \* | -dir(ectory)? \S+ | -file \S+ ) # Label: \w+ }x;