Regular Expressions 101

Community Patterns

Find JSON key with any value except the values given


Regular Expression
PCRE2 (PHP >=7.3)

\"asento\": ((?:(?!(\"vasen\"|\"oikea\")).)*),\s*$


Use this regular expression if you search through a big JSON file and you are looking whether a specific key holds any value different than the ones given.

Submitted by Sebastian Zander - 3 years ago (Last modified 3 years ago)