can anyone tell me why second match operator doesnt find a match when the only difference between the two strings is the open brace at the end.
Code:$_ = "ax bx : cx dx {";
$a = "ax";
$b = "(?:_)?\\w";
$c = "cx";
$d = "dx";
$str1 = "^$a\\s+(b)(?:\\s+:\\s+$c\\s+$b)?\\s*";
$str2 = "^$a\\s+(b)(?:\\s+:\\s+$c\\s+$b)?\\s*{";
print "1.".m/$str1/."\n";
print "2.".m/$str2/."\n";
print "\n";