I have some subjects which looks like this:
hu
ha
ho
hi
My pattern looks like this #^(h.+)$#
which is returning all my strings as true. This is expected. Now I want to only select strings which do not contain o.
How can I add a negative condition to my regex?
Replace
.with[^o], which matches all characters excepto.The
[]denote a character class, and the leading^inverts it.