I am looking through 1000s of JSON files, and all of them have a property on them like this: "value": {some number},
I want to grep all of these JSON files, and match all cases where value is NOT equal to 1,2, or 3. So if "value": 10? Grep should return that. "value": 1? Grep should not return that.
The best regex I can get is .*\"value\": ((?!1)|(?!2)|(?!3)) But I must not know enough have negative lookaheads to use this correctly, am I close? Is there a better way to do NOT operations in regex?
Regular expression to match a line that doesn't contain a word is the closest answer I've found, but I cannot figure out how to apply it to this case where I have a set of substrings.
With jq:
Input file:
Output:
Will works too with multiple JSON files.