In this example I want to select all words, except those between quotes (i.e. "results", "items", "packages", "settings" and "build_type", but not "compiler.version").
results[0].items[0].packages[0].settings["compiler.version"]
results[0].items[0].packages[0].settings.build_type
Here's what I know: I can target all words with
[a-z_]+
and then target what's in between quotes with this:
(?<=\")[\w.]+(?=\")
Is there any way to match the difference between the results of the first and second regex? (i.e. words except if they are surrounded by double quotes)
Here's a regex playground with the example for convenience.