core: fix evaluation of expression with regex when a comparison char is in the regex