I'm not sure if this is an improvement: the `input` would need escaping before interpolating into the regular expression.