[[ foo =~ ERE ]] does not match EREs with parentheses
Problem 1:
$ yash -c '[[ aaa =~ (foo|^a{2,}$) ]]' yash -c:1: syntax error: `(' is not a valid operand in the conditional expression
The syntax error should not occur: parentheses are perfectly valid in EREs (extended regular expressions).
Problem 2:
$ ere='(foo|^a{2,}$)' yash -c '[[ aaa =~ $ere ]]'; echo $? 1
This should have matched, so should have returned 0.
The =~ operator in the test/[ builtin does not have either of these problems.
Will address this issue in #39094.
Problem 1 was fixed in r4151 and problem 2 in #39288. Thanks!
Problem 1:
The syntax error should not occur: parentheses are perfectly valid in EREs (extended regular expressions).
Problem 2:
This should have matched, so should have returned 0.
The =~ operator in the test/[ builtin does not have either of these problems.