This fixes a problem introduced in
c7b31b02422265e11b68992e58ef5638cf2e568e.
The changes by @tobibeer inadvertently made the regular expression
evaluation significantly more expensive because of lookahead. The is
less elegant but reverts the performance problem.