Use the right regex operators here.

Resolves #994.