I want to test that a given string does not belong to the following group of strings: 22 75.
Could anyone please tell why PHP\'s preg_match(\"/[^(22|75)]/\
preg_match(\"/[^(22|75)]/\
^ inside of [...] is a negation of a character list. (22|76)
Regex multiple character negation is a very tricky subject and can't be easily resolved.
But you could invert the return result of preg_match function ie.:
if(!preg_match('@22|76@', '25', $matches)) doSomething();