[core] test existence of negative pattern before checking token