Reputation: 494
New to regex (python). I have a data set that looks like this
{"Model": "NV3500 HD Cargo"},{"Model": "Armada"},{"Model": "Rogue"}, {"Model": "Frontier Crew Cab"},{"Model": "NV2500 HD Cargo"}, {"Model": "TITAN XD Single Cab"},{"Model": "Altima"},
I am attempting to only match what model value is IE NV3500 HD Cargo
or Frontier Crew Cab
I am using this expression to match \b(?!Model\b)\w+
it matches the correct terms however with models that have spaces it treats them as induvial matches
How can I treat it as one word
Upvotes: 0
Views: 44
Reputation: 1478
\b(?!Model\b)([\w\s]+)
Put also it in group.
if you want to capture symboles also, use
\b(?!Model\b)([^\"]+)
Upvotes: 2