Answer

Answer:

(subtotal\s*[\d.]+)|(total\s*[\d.]+)

Your code to check to see if sub group 2 is empty and ignore sub group 1.