match string with not a specific word regex code example Example: regex negate ^(?!.*bar).*$ serial_number: [^((?!null).)*$]+