Improved equation label extraction

Adding a non-greedy character to the regular expression for extracting
equation labels fixed some problems with brackets inside equations.