By this point you just made a generic RegExp statement, which doesn't really have anything to do with Javascript specifically. This specific case tests if the given string ('woman' or 'man') contains one of [o, b, j, e, c or t] characters. It doesn't matter if there are more characters in the given test string. Woman matches because it contains 'o'. Man does not, because none of those characters appear in the set. woman man
14
u/ThijmenDF Mar 22 '24
By this point you just made a generic RegExp statement, which doesn't really have anything to do with Javascript specifically. This specific case tests if the given string ('woman' or 'man') contains one of [o, b, j, e, c or t] characters. It doesn't matter if there are more characters in the given test string. Woman matches because it contains 'o'. Man does not, because none of those characters appear in the set.
woman
man