diff --git a/Configure b/Configure index 4a23d26a9b..7738073455 100755 --- a/Configure +++ b/Configure @@ -1831,23 +1831,13 @@ if ($builder eq "unified") { my $variable_name_re = qr/(?P[[:alpha:]][[:alnum:]_]*)/; # Value modifier syntaxes my $variable_subst_re = qr/\/(?P(?:\\\/|.)*?)\/(?P.*?)/; - # Put it all together - my $variable_re = qr/\$ - (?| - # Simple case, just the name - ${variable_name_re} - | - # Expressive case, with braces and possible - # modifier expressions - \{ - ${variable_name_re} - (?: - # Pile on modifier expressions, - # separated by | - ${variable_subst_re} - ) - \} - )/x; + # Variable reference + my $variable_simple_re = qr/(?(?:\\\/|.)*?)\}/; + # Tie it all together + my $variable_re = qr/${variable_simple_re}|${variable_w_mod_re}/; + my $expand_variables = sub { my $value = ''; my $value_rest = shift; @@ -1856,25 +1846,29 @@ if ($builder eq "unified") { print STDERR "DEBUG[\$expand_variables] Parsed '$value_rest' ...\n" } - while ($value_rest =~ /(?