0

I've a string like:

{\"clearExistingTargeting\":\"Yes\",\"campaignid\":\"[CampaignID]\",\"targeting\":{\"appsitetargeting\":{\"[filterout]\":{\"site\":\"www.google.com\",\"app\":\"com.facebook\"},\"filterin\":{\"site\":\"www.gmail.com\",\"app\":\"com.lw.sdk\"}}}}

I want to extract all those string which are enclosed in [] like [CampaignID] and [filterout], I am trying with regular expression - (\\[.*\\]) but its giving the output

[CampaignID]\",\"targeting\":{\"appsitetargeting\":{\"[filterout]

Its matching from the first [ but ending with the last ].

Alan Moore
  • 73,866
  • 12
  • 100
  • 156
Pankaj Kumar Katiyar
  • 1,474
  • 1
  • 20
  • 36

0 Answers0