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 ].