Tweak regexp operations, fixes #282