My string looks like this:
(left.e0_coefficient*right.Scalar) e₀ + (left.e1_coefficient*right.Scalar) e₁ + (left.e2_coefficient*right.Scalar) e₂ + (left.e3_coefficient*right.Scalar) e₃
I want to get the expression thats contained in the parentheses preceeding e₂ => left.e2_coefficient*right.Scalar
I tried using \((.+?)\) e₂
however despite it being lazy (non-greedy) the capturing group still contains everything from the first parenthesis in the string to the one immediately before e₂ => left.e0_coefficient*right.Scalar) e₀ + (left.e1_coefficient*right.Scalar) e₁ + (left.e2_coefficient*right.Scalar
I think I might have to use a positive-lookbehind or some other form of non-greediness, but I cant figure it out.