Revert 46f1770 to address a huge performance regression. [FIXED JENKINS-20037]

46f1770 caused the regression in performance seen this issue: https://issues.jenkins-ci.org/browse/JENKINS-20037

Reverting to use the more conservative .matches reduces parse time back to a reasonable level.