Simplify a regex a bit.

We don't need the optional conditions as they are handled earlier now.