encode regex to match the string, reject dummy encodings
comment on encoding