I tried matching addition expressions with brackets (e.g.: 1+1, 1+(2+3)+4) using the following code:
ParserElement.enable_left_recursion()
b=Forward()
a=b+'+'+b|'('+b+')'|Word(nums)
b<<a
However, it didn't work correctly: (1+1) can be matched, but not 1+1.
I tried many ways to fix like changing | into ^ and swapping the operands of |, but none of them worked.
What have I done wrong? Is it a bug or is it an unsupported feature?