I have below object returned by a particular function
{\"count\":3,
\"items\":[
{
\"organizationCode\": \"FP1\",
\"organiza
So the first step would be to accept the user input. Then if they include '
or "
in their query, strip those characters off of their search. It's not necessary for this pattern. Once you've done that, you can use this pattern to find matches (?<=organization(?:Name|Code)":)\s+(?i)"T11"
. You'll want to replace the T11
portion of the pattern with whatever their stripped query is. This will not be case sensitive. If you need the pattern to be case sensitive you can remove the (?i)
.
Demo