Regular Expressions 101

Community Patterns

Find JSON key with any value except the values given

0

Regular Expression
PCRE2 (PHP >=7.3)

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

Description

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 - 2 years ago (Last modified 2 years ago)