Fixed pattern "X%Y" with no Y defined throwing an exception.

Fixes WORLDEDIT-2897.