Fix infinite memory-eating loop.

Reading from $problem->areas is a new string each time, so the
global regex gets reset and the loop never ends. Look up the value
once, first, to prevent this.