someCondition has two bits, one for Rule.Condition.Space and one for Rule.Condition.NewLine . someCondition & condition will have one bit if the condition is Space or NewLine, otherwise 0 .
You should check if the bitwise operation returns 0 instead of checking for equality with someCondition
if ((someCondition & condition) != 0) return true
source share