Rewrote and added tests for check_operator_regex.